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

Nested imports not working anymore with v1.4.4.1 #8595

Closed
jer-sen opened this issue Apr 13, 2017 · 9 comments
Closed

Nested imports not working anymore with v1.4.4.1 #8595

jer-sen opened this issue Apr 13, 2017 · 9 comments
Assignees
Milestone

Comments

@jer-sen
Copy link

jer-sen 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
Copy link

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
Copy link
Contributor

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
Copy link

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
Copy link

tab00 commented Apr 13, 2017

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

@abernix
Copy link
Contributor

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).

@jer-sen
Copy link
Author

jer-sen 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 to version 0.20.1 and reify to 0.7.4.
* Bump $BUNDLE_VERSION to 4.7.25 before rebuilding dev bundle.
@benjamn
Copy link
Contributor

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.

@jer-sen
Copy link
Author

jer-sen commented Apr 14, 2017

Fixed ! Thanks.

@tab00
Copy link

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 pushed a commit that referenced this issue Apr 25, 2017
* 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 pushed a commit that referenced this issue Apr 25, 2017
* 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.
StorytellerCZ pushed a commit that referenced this issue Sep 30, 2021
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

4 participants