[1.4.2-rc.4] super does not work in some cases because __proto__ is not set #7956
Comments
I agree this is a bug. Fortunately we can fix it with an update to |
As 1.4.2 is now released, how can i update babel-runtime separatly? |
Is this why my 2x subclassing of |
Same for me, I am subclassing Mongo.Collection and have error 'insert undefined' since 1.4.2 release. Is the issue is linked ? |
Here's the original explanation of why we chose not to set The good news is that Babel now attempts to work around the limitations of older IEs by using |
I think I know how to fix this, but I'm having trouble reproducing it. Can anyone provide a small example app that has this problem? |
I tried to, but I can't get it to not work either in a new project. In my current project, however, this code:
yields:
|
FYI: I also added my packages file. |
@benjamn: so why was it working in previous versions of meteor? I never checked on IE versions below 10, was it just not working there? I am also not sure, if it is a good decision to make a regression for all browsers, because it does not work on a IE < 10... anyway, I hope 1.4.2.1 will land soon, that we can profit from the awesome performance tweaks :-) I try to setup a reproduction... |
ok @benjamn , here is a reproduction based on uniforms's demo-project. I added a custom form-theme that uses static classes along the themes installed from npm. (mine is a uncompiled copy from uniforms-unstyled) https://github.com/macrozone/meteor-1.4.2-static-inheritance-reproduction clone, npm install and start it. It's running meteor 1.4.1. Then on the page, you can select the form-themes. Every theme including my local "custom"-theme should work. Then update to meteor 1.4.2. ~~now, the custom-form will not work anymore. (will throw an error in the console). ~~ On my first try, only my custom-form did not work anymore. But now, as i am writing this issues, all theme do not work anymore under 1.4.2 due to the same problem. hope this helps. |
@macrozone It worked in previous versions of Meteor because we just copied static properties, which worked equally well in all browsers. What changed was a newer version of Babel assuming that |
Ok, after digging into that reproduction (thanks @macrozone!), it looks like the source of the problem is code in Short-term, making sure Longer term, we need to evaluate whether implementing Babel helpers in a Meteor specific way still has its original values: minimizing the use of unnecessary runtime libraries, and supporting older browsers. If |
This should be fixed if you run |
ok, i updated to 1.4.2.1-beta.0, but the problem still exists. Do i need to meteor reset, wipe node_modules or similar? |
Might be your build cache.
|
I think this is somehow related - also got the error after upgrading to 1.4.2 What I did now is: I still get the same uniforms error |
@sakulstra @benjamn |
Me too, doesn't work after updating to |
Mine worked after deleting
|
In light of issues like #7956, I would very much like for app developers to be responsible for providing node_modules/babel-runtime, and for the Meteor babel-runtime package to stop attempting to implement a subset of the helpers.
Though this may seem like a significant change, this package will still work for older apps as long as the developer follows the instructions about installing the babel-runtime npm package. Helps with #7956.
My commit 9dfcc38 might be enough to fix this issue in combination with reinstalling |
Perhaps doing a build-cache clear post release update would suffice? |
@benjamn clearing .meteor/local did not help or instlaling node_modules. instead, i had to bump version in .meteor/versions of babel-runtime to babel-runtime@0.1.13 |
In light of issues like #7956, I would very much like for app developers to be responsible for providing node_modules/babel-runtime, and for the Meteor babel-runtime package to stop attempting to implement a subset of the helpers.
Though this may seem like a significant change, this package will still work for older apps as long as the developer follows the instructions about installing the babel-runtime npm package. Helps with #7956.
Meteor 1.4.2.1-beta.1 contains some noteworthy changes to the way Closing now because the problem is fixed for me, but please reopen if you discover otherwise. |
Meteor 1.4.2-rc.4 seems to break some npm packages: vazco/uniforms#117
I could not fully track this down, but what I found out is, that the meteor-version of babel-runtime does not set proto / Object.setPrototypeOf
Compare this:
meteor version: https://github.com/meteor/meteor/blob/devel/packages/babel-runtime/babel-runtime.js#L81
with this:
babel version: https://github.com/babel/babel/blob/master/packages/babel-helpers/src/helpers.js#L378
super() is transformed to this:
var _this = (0, _possibleConstructorReturn3['default'])(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, props));
When running under meteor 1.4.2,
_class.__proto__
is just an empty anonymous function, whereas under meteor 1.4.1.x_class.__proto__
is set to a constructor-functionIt might be also related to the fact, that this particular package uses static properties. I can't imagine, that inheritance just breaks without noticing.
Anyone an idea, what's going on here?
The text was updated successfully, but these errors were encountered: