-
-
Notifications
You must be signed in to change notification settings - Fork 38
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined is not a constructor (evaluating 'Object.assign') #59
Comments
As a follow up, I've tried adding
Then updating my babel config as follows:
With
As far as I can see, this should do it but running up the tests in PhantomJS still reports the same error as above. For completeness, this is my
|
OK, I think I fixed it now. I added the following to my
And it all seems to work without any errors. As I'm not sure if this is the correct way to do this, I'll leave this issue open. If there is a better way, the please let me know. Thanks |
Hey @andypike. import "babel-polyfill"; Installs all available polyfills for dev and prod environments. I would recommend adding Also, phantomjs is unmaintained (thats why we don't have |
@andypike Thanks for this line:
I had a similar problem, while test failed in PhantomJS, debugging in Chrome did not. Saved a lot of headache! |
@andypike your solution solved my issue, thanks! |
Firstly sorry if this is a stupid question, but I'm new to this new js world. We used to just add script tags and everything was fine 馃槀 . Also, this maybe nothing to do with babel-brunch, but it seems like the right place to start asking questions.
Anyway, I have a project that uses babel-brunch. It include a few npm modules and in the latest Chrome browser everything is working fine. However, when I run my tests using PhantomJS, I get the following error:
Looking at
app.js:12404
it's this line:And this comes from the npm package
vuetify
(https://www.npmjs.com/package/vuetify).From my understanding,
Object.assign
is a new ES6 thingy and PhantomJS (and other browsers) do not support that yet, hence the error. So I assume I need a polyfill for this to work in browsers that only support ES5.Looking at your readme and some of the issues, I think this should already be included in babel-brunch so I'm not sure why it isn't working.
For completeness my brunch config is below but is pretty slim and almost the default generated by Elixir Phoenix 1.3:
I'm obviously missing something, but not sure if it's a config thing or a missing package or what not.
Any help or advice would be greatly appriciated!
Thanks in advance!
Andy
鉂わ笍
The text was updated successfully, but these errors were encountered: