Skip to content

TypeError: Cannot convert a Symbol value to a string with certain libraries #833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andrewisaburden opened this issue Jul 18, 2018 · 0 comments
Labels

Comments

@andrewisaburden
Copy link

andrewisaburden commented Jul 18, 2018

Version

1.0.0-beta.20

Reproduction link

https://github.com/andrewisaburden/vue-test-utils-symbol-error

Steps to reproduce

Run yarn test:unit in the terminal.

What is expected?

The test should pass with no errors.

What is actually happening?

TypeError: Cannot convert a Symbol value to a string is printed on attempting to mount localVue.


This happens with several libraries (vue-js-modal, vue-material, vue2-google-maps for example). When vue-test-utils tries to deepClone the localVue which is using one of the relevant libraries, it attempts to call Symbol(Symbol.toStringTag) in Object(value) (line 462 in vue-test-utils.js). hasHandler() fails, and tries to print that Property or method Symbol(Symbol.toStringTag) is not defined on the instance.... However, Symbol(Symbol.toStringTag) does not resolve to a string unless cast to a string (e.g. String(key) in warnNonPresent()).

Even once it does resolve to a string by casting to a String, the underlying issue still exists. I don't know how to further investigate the issue, but at this stage it seems to be a vue-test-utils issue rather than an external library issue.

Possibly related issues:
euvl/vue-js-modal#246
#452

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants