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

Nested imports not working anymore with v1.4.4.1 #8595

Closed
jay1337 opened this Issue Apr 13, 2017 · 9 comments

Comments

Projects
None yet
4 participants
@jay1337

jay1337 commented Apr 13, 2017

Hello,

Nested imports in my app do not work anymore with new version 1.4.4.1 (everything was ok with 1.4.3.2).
.
When I try to run my app, I get this error:

W20170413-16:24:50.671(2)? (STDERR) D:\todo\.meteor\local\build\programs\server\app\app.js:3029 W20170413-16:24:50.848(2)? (STDERR) import { mailError } from '/server/mailing.js'; W20170413-16:24:50.851(2)? (STDERR) ^^^^^^ W20170413-16:24:50.853(2)? (STDERR) W20170413-16:24:50.855(2)? (STDERR) SyntaxError: Unexpected reserved word

The source code is something like:

export const myFunction= function(arg) { // ... const res = otherFunction(); // ... if (arg == res) { import { mailError } from '/server/mailing.js'; mailError("Error !"); } // ... };
Thanks for your help.

@tab00

This comment has been minimized.

tab00 commented Apr 13, 2017

After updating I'm getting "SyntaxError: Unexpected reserved word" error too, referring to the word import with code that looks like this:

export const method1 = new ValidatedMethod({
     name: "method1",
     validate: null,
     run() {
         import Pusher from "pusher-client"
     }
 });

I have so many imports all over the place and I don't want to have to rewrite them all to requires, so my app is now broken.

Please fix this as soon as possible. Thank you.

@benjamn

This comment has been minimized.

Member

benjamn commented Apr 13, 2017

Are either of you using .babelrc files? As always, we really need a small reproduction in order to help you, since nested import declarations have plenty of tests, and should definitely still work.

@tab00

This comment has been minimized.

tab00 commented Apr 13, 2017

No, I don't use .babelrc files.

The error appears at a final stage of build even when I create a skeleton app using meteor create test and write a simple function like above.

@tab00

This comment has been minimized.

tab00 commented Apr 13, 2017

I'm using Windows 10 platform, in case that may be relevant.

@abernix

This comment has been minimized.

Member

abernix commented Apr 13, 2017

Posting this forum post here about the same topic: https://forums.meteor.com/t/did-meteor-1-4-4-remove-conditional-imports/35621 (no reproduction, unfortunately, but they are using a .babelrc with only babili in it).

@jay1337

This comment has been minimized.

jay1337 commented Apr 13, 2017

I don't use .babelrc file. I'm using Windows 7.

@benjamn benjamn reopened this Apr 14, 2017

benjamn added a commit that referenced this issue Apr 14, 2017

Upgrade meteor-babel and reify to fix #8595. (#8599)
* Upgrade meteor-babel to version 0.20.1 and reify to 0.7.4.
* Bump $BUNDLE_VERSION to 4.7.25 before rebuilding dev bundle.
@benjamn

This comment has been minimized.

Member

benjamn commented Apr 14, 2017

This should be fixed if you update the babel-compiler package to version 6.18.2 by running meteor update. Thanks for reporting this issue, and I hope you'll take some time to test beta versions of future Meteor releases, to help identify regressions like this one.

@jay1337

This comment has been minimized.

jay1337 commented Apr 14, 2017

Fixed ! Thanks.

@tab00

This comment has been minimized.

tab00 commented Apr 14, 2017

It is now indeed fixed. Thank you Ben.

@benjamn benjamn added this to the Release 1.4.4 milestone Apr 14, 2017

@benjamn benjamn added the fixed label Apr 14, 2017

abernix added a commit that referenced this issue Apr 25, 2017

Upgrade meteor-babel and reify to fix #8595. (#8599)
* Upgrade meteor-babel to version 0.20.1 and reify to 0.7.4.
* Bump $BUNDLE_VERSION to 4.7.25 before rebuilding dev bundle.

abernix added a commit that referenced this issue Apr 25, 2017

Upgrade meteor-babel and reify to fix #8595. (#8599)
* Upgrade meteor-babel to version 0.20.1 and reify to 0.7.4.
* Bump $BUNDLE_VERSION to 4.7.25 before rebuilding dev bundle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment