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

1.3.3.1 failed processing `switch` in conditional importing #7250

Closed
WayneUong opened this Issue Jun 18, 2016 · 9 comments

Comments

@WayneUong

WayneUong commented Jun 18, 2016

On Mac OSX

[[[[[ ~/nfc-meteor ]]]]]

=> Started proxy.

=> Started MongoDB.

=> Errors prevented startup:

While processing files with ecmascript (for target web.browser):

/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/lib/compiler.js:102:23:
Object [object Object] has no method 'BlockStatement'
at Context.types.PathVisitor.fromMethodsObject.getBlockBodyPath
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/lib/compiler.js:102:23)
at Context.types.PathVisitor.fromMethodsObject.hoistImports
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/lib/compiler.js:147:25)
at Context.types.PathVisitor.fromMethodsObject.visitImportDeclaration
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/lib/compiler.js:229:10)
at Context.invokeVisitorMethod
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/node_modules/ast-types/lib/path-visitor.js:342:43)
at Visitor.PVp.visitWithoutReset
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/node_modules/ast-types/lib/path-visitor.js:194:28)
at NodePath.each
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/node_modules/ast-types/lib/path.js:99:22)
at visitChildren
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/node_modules/ast-types/lib/path-visitor.js:217:14)
at Visitor.PVp.visitWithoutReset
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/node_modules/ast-types/lib/path-visitor.js:202:16)
at visitChildren
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/node_modules/ast-types/lib/path-visitor.js:244:21)
at Visitor.PVp.visitWithoutReset
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/node_modules/ast-types/lib/path-visitor.js:202:16)
at NodePath.each
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/node_modules/ast-types/lib/path.js:99:22)
at visitChildren
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/node_modules/ast-types/lib/path-visitor.js:217:14)
at Visitor.PVp.visitWithoutReset
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/node_modules/ast-types/lib/path-visitor.js:202:16)
at visitChildren
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/node_modules/ast-types/lib/path-visitor.js:244:21)
at Visitor.PVp.visitWithoutReset
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/node_modules/ast-types/lib/path-visitor.js:202:16)
at NodePath.each
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/node_modules/ast-types/lib/path.js:99:22)
at visitChildren
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/node_modules/ast-types/lib/path-visitor.js:217:14)
at Visitor.PVp.visitWithoutReset
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/node_modules/ast-types/lib/path-visitor.js:202:16)
at visitChildren
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/node_modules/ast-types/lib/path-visitor.js:244:21)
at Visitor.PVp.visitWithoutReset
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/node_modules/ast-types/lib/path-visitor.js:202:16)
at Visitor.PVp.visit
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/node_modules/ast-types/lib/path-visitor.js:131:25)
at Object.compile
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/node_modules/reify/lib/compiler.js:23:23)
at /Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/index.js:61:33
at Cache.Cp.get
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/cache.js:94:19)
at Object.compile
(/Users/NFC/.meteor/packages/ecmascript/.0.4.5.xf6k52++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/index.js:47:23)
at Object.Babel.compile (packages/babel-compiler/babel.js:26:1)
at packages/babel-compiler/babel-compiler.js:109:1
at Function.time (/tools/tool-env/profile.js:305:10)
at profile (packages/babel-compiler/babel-compiler.js:139:1)
at BabelCompiler.BCp.processOneFileForTarget (packages/babel-compiler/babel-compiler.js:108:1)
at BabelCompiler. (packages/babel-compiler/babel-compiler.js:21:1)
at Array.forEach (native)
at BabelCompiler.BCp.processFilesForTarget (packages/babel-compiler/babel-compiler.js:20:1)

=> Your application has errors. Waiting for file change.

@laosb

This comment has been minimized.

Collaborator

laosb commented Jun 18, 2016

Can you reproduce this in the default app?

@WayneUong

This comment has been minimized.

WayneUong commented Jun 18, 2016

Not sure which default app you're referring to, but I tried to update the simple-todos app to 1.3.3.1 and it works fine.
https://github.com/meteor/simple-todos

@WayneUong

This comment has been minimized.

WayneUong commented Jun 18, 2016

This seems to be the piece of code that causes the error:

/client/index.js

switch (Meteor.settings.public.app) {
    case 'main':
        import '../imports/client/main.js';
        break;
    case 'admin':
        import '../imports/client/admin.js';
        break;
}

I use a setting to have different apps in the same repo to load different sets of scripts. This was working fine with 1.3.3 though.

@laosb

This comment has been minimized.

Collaborator

laosb commented Jun 18, 2016

I mean the clean app created by meteor create by saying default app. My fault. You may need to add something on the clean app to reproduce that.

Or to be simple, Does this happen to a newly-meteor created app?

@WayneUong

This comment has been minimized.

WayneUong commented Jun 18, 2016

If I don't conditionally load import js files, it works fine like this:

import '../imports/client/main.js';

@WayneUong

This comment has been minimized.

WayneUong commented Jun 18, 2016

If statement seems to work as well, only switch statement causes errors:

if (Meteor.settings.public.app == 'main') {
    import '../imports/client/main.js';
}
@laosb

This comment has been minimized.

Collaborator

laosb commented Jun 18, 2016

image

Did reproduce in a 1.3.3.1 app, and it only happens with switch, not if.

@laosb laosb changed the title from 1.3.3.1 failed while processing files with ecmascript to 1.3.3.1 failed processing `switch` in conditional importing Jun 18, 2016

@benjamn benjamn self-assigned this Jun 20, 2016

benjamn added a commit to benjamn/reify that referenced this issue Jun 20, 2016

@benjamn benjamn added this to the 1.3.3.2 milestone Jun 20, 2016

@benjamn benjamn referenced this issue Jun 20, 2016

Merged

Release 1.3.4 #7263

6 of 6 tasks complete
@benjamn

This comment has been minimized.

Member

benjamn commented Jun 20, 2016

Please try updating to the latest release candidate: meteor update --release 1.3.4-rc.0

@benjamn

This comment has been minimized.

Member

benjamn commented Jun 22, 2016

Closing now; please reopen if the issue persists after meteor update --release 1.3.4-rc.2.

@benjamn benjamn closed this Jun 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment