aurelia / bundler

A library for bundling JavaScript, HTML and CSS for use with SystemJS.
MIT License
37 stars 25 forks source link

Bundling Error on instantiate for npm:aurelia-loader-default #87

Closed ne0guille closed 8 years ago

ne0guille commented 8 years ago

I'm having an issue on my build server when running the bundler, its working fine on my local enviroment but failing on the build server

Would love to here some suggestions of how can i fix this and why its happening.

Thanks!

here is the error log.

Error on instantiate for npm:aurelia-loader-default@1.0.0-beta.1.0.1/aurelia-loader-default.js at fileaurelia-loader-default@1.0.0-beta.1.0.1/aurelia-loader-default.js Loading npm:aurelia-loader-default@1.0.0-beta.1.0.1.js Error: Multiple anonymous defines. at ParseTreeTransformer.AMDDependenciesTransformer.transformCallExpression (node_modules\jspm\node_modules\systemjs-builder\compilers\amd.js:98:13) at CallExpression.args.transform (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:6649:28) at ParseTreeTransformer.transformAny (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:9193:44) at ParseTreeTransformer.transformExpressionStatement (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:9504:31) at ExpressionStatement.expression.transform (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:7120:28) at ParseTreeTransformer.transformAny (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:9193:44) at ParseTreeTransformer.transformList (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:9200:34) at ParseTreeTransformer.transformFunctionBody (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:9574:31) at FunctionBody.statements.transform (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:7293:28) at ParseTreeTransformer.transformAny (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:9193:44) at ParseTreeTransformer.transformFunctionExpression (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:9596:25) at ParseTreeTransformer.AMDDependenciesTransformer.transformFunctionExpression (node_modules\jspm\node_modules\systemjs-builder\compilers\amd.js:61:69) at FunctionExpression.body.transform (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:7339:28) at ParseTreeTransformer.transformAny (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:9193:44) at ParseTreeTransformer.transformBinaryExpression (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:9299:26) at BinaryExpression.right.transform (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:6557:28) at ParseTreeTransformer.transformAny (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:9193:44) at ParseTreeTransformer.transformExpressionStatement (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:9504:31) at ExpressionStatement.expression.transform (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:7120:28) at ParseTreeTransformer.transformAny (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:9193:44) at ParseTreeTransformer.transformList (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:9200:34) at ParseTreeTransformer.transformBlock (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:9317:31) at Block.statements.transform (node_modules\jspm\node_modules\systemjs-builder\node_modules\traceur\bin\traceur.js:6612:28) 'build-dev' errored after 11 s Error in plugin 'run-sequence' Message: An error occured in task 'bundle-vendor'.

plwalters commented 8 years ago

Are you running traceur instead of babel? Looks like you are doing on-the-fly tranpilation?

plaliberte commented 8 years ago

We are running babel and get this exact same issue pointing to traceur regardless

ne0guille commented 8 years ago

we are using babel, idk why its getting this traceur message. here is the config

System.config({ defaultJSExtensions: true, transpiler: "babel", babelOptions: { "modules": "system", "moduleIds": false, "comments": false, "compact": false, "stage": 2, "optional": [ "es7.decorators", "es7.classProperties", "runtime" ] }

AlexanderDzhoganov commented 8 years ago

I can confirm the same issue occurs here with loader-default beta-1.1.2.

Error log from gulp bundle (xxx inserted by me to mask local paths):

Error on instantiate for npm:aurelia-loader-default@1.0.0-beta.1.1.2/aurelia-loader-default.js at xxx/jspm_packages/npm/aurelia-loader-default@1.0.0-beta.1.1.2/aurelia-loader-default.js
    Loading npm:aurelia-loader-default@1.0.0-beta.1.1.2.js
    Error: Multiple anonymous defines.
  at ParseTreeTransformer.AMDDependenciesTransformer.transformCallExpression (xxx/node_modules/systemjs-builder/compilers/amd.js:98:13)
  at CallExpression.$__super.transform (xxx/node_modules/traceur/bin/traceur.js:6649:28)
  at ParseTreeTransformer.transformAny (xxx/node_modules/traceur/bin/traceur.js:9193:44)
.. a lot more lines like above ..

bundles.json config.js package.json

ne0guille commented 8 years ago

@AlexanderDzhoganov @ne0guille I started getting the same error on my build server today too. It built fine last night at 3am EST and failed today at 1pm EST. Looking at systemjs-builder on github a new release (0.15.10) was released 5 hours ago and I think that release is what is causing the issues. The aurelia-bundler uses systemjs-builder as a dependency.

this might be useful to known

AlexanderDzhoganov commented 8 years ago

Thanks to @donald-slagle and @ne0guille 's information I have narrowed down the issue to this commit in systemjs/builder which adds this check in compilers/amd.js which gets triggered by the define() in addPlugin in aurelia/loader-default@index.js.

plwalters commented 8 years ago

How are you getting it to download the latest systemjs builder? Trying to reproduce to find a fix.

AlexanderDzhoganov commented 8 years ago

@PWKad I deleted my node_modules and did npm install which installed the latest builder, as the others I first encountered the issue on our build servers which do a fresh npm install on every build

AlexanderDzhoganov commented 8 years ago

As a workaround you can do

npm install && npm install systemjs-builder@0.15.9

which will roll back systemjs/builder to 0.15.9 which didn't have this issue. This will only work with npm 3+.

plwalters commented 8 years ago

Thanks for helping to narrow this down everyone I've got a hotfix I'm about to push out to get around.