Skip to content
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

"Can't find variable: Symbol" on Poltergeist #52

Closed
vizcay opened this issue Jun 21, 2018 · 3 comments
Closed

"Can't find variable: Symbol" on Poltergeist #52

vizcay opened this issue Jun 21, 2018 · 3 comments
Assignees

Comments

@vizcay
Copy link

vizcay commented Jun 21, 2018

Hi, we've recently migrated to bootstrap v4.1.1 in our Ruby on Rails app, so we upgraded bootstrap-submenu v3.0.0 because we were using v2.x. We are very pleased how it looks and it was a life-safer after bootstrap v3.x dropped submenu support, thanks for your work.

After migration, everything looks fine, but this particular app is being feature tested with phantomjs v2.1.1. This driver doesn't supports all the new ES6 features, so the code on /dist that uses Symbol produces this error.

Because your source doesn't uses Symbol, I'm pretty sure this is being added on transpilaton with Babel, but not being JS my primary language or node my toolset I'm a little lost. I'm pretty sure there is some setting I can modify on package.json to output ES5 compatible code..

But do you thing is a good idea to output non ES5 compatible code on dist? Browser compatibilty will suffer (for example IE won't support it even now).

@vizcay
Copy link
Author

vizcay commented Jun 22, 2018

Well after more investigation this problem is pretty common, for example https://til.hashrocket.com/posts/b4c0e5d1a4-cant-find-variable-symbol.

One option is to use https://babeljs.io/docs/en/babel-polyfill/, but I didn't want to include a polyfill just for my tests to run. So I cloned your project and replaced for .. of with a simple for and is working again. I will fork and push in my profile if somebody else needs it.

@vsn4ik vsn4ik self-assigned this Jun 30, 2018
@vsn4ik
Copy link
Owner

vsn4ik commented Jul 7, 2018

Thanks @vizcay. Fixed in v3.0.1

@vsn4ik vsn4ik closed this as completed Jul 7, 2018
@vizcay
Copy link
Author

vizcay commented Jul 9, 2018

@vsn4ik thanks, I've just tested it and is working with your changes.

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

No branches or pull requests

2 participants