Ngx-chips: SystemJS builder error

Created on 4 Oct 2016  Â·  13Comments  Â·  Source: Gbuomprisco/ngx-chips

Hi. and thank you for bringing this awesome module to angular 2.

I'm having some problems when I try to build my application with the Systemjs builder, it seems like there's some define errors when importing the module to the build process. I am able to use the module during development (typescript compiles correctly and such) but when I try to make a build it throws the following error:

Unhandled rejection Error on dependency parsing for npm:ng2-tag-input/dist/ng2-tag-input.bundle.js at file:///C:/dev/tagModuleTest/node_modules/ng2-tag-input/dist/ng2-tag-input.bundle.js

    Loading app/app.module.js
    Loading app/main.js
    Error: Multiple anonymous defines.

I've tested this by using a barebone quickstart project from angular to get the bare minimum, I'll zip it down and attach it here for reference.

As angular 2 is pretty new (especially the final release) it's quite hard to get some definitive answers on what is wrong here, I'll try to dig a bit deeper into this and will follow up if I get any eureka moments.

Best Regards,
/ Glenn
tagModuleTest.zip

bug help wanted

Most helpful comment

@sumitdhameja I am seeing the same behavior you are.

All 13 comments

Hi @Fagertveit, thanks, I'll have a look. SystemJS is giving me a lot of headaches lately :)

having the same problem here, also newest version 0.4.4 does not work at all with systemjs.

Hi @johntzan,

Can you post here your systemjs config please?Thanks

Having the same issue

Error on dependency parsing for ng2-tag-input at file:///Users/ej049491/Documents/infinity/node_modules/ng2-tag-input/dist/ng2-tag-input.bundle.js Loading dist/tmp/web.module.js Loading dist/tmp/main.web.js Error: Multiple anonymous defines. at ParseTreeTransformer.AMDDependenciesTransformer.transformCallExpression (/Users/ej049491/Documents/infinity/node_modules/systemjs-builder/compilers/amd.js:98:13) at CallExpression.transform (/Users/ej049491/Documents/infinity/node_modules/systemjs-builder/node_modules/traceur/bin/traceur.js:6948:28) at ParseTreeTransformer.transformAny (/Users/ej049491/Documents/infinity/node_modules/systemjs-builder/node_modules/traceur/bin/traceur.js:9514:44) at ParseTreeTransformer.transformExpressionStatement (/Users/ej049491/Documents/infinity/node_modules/systemjs-builder/node_modules/traceur/bin/traceur.js:9825:31) at ExpressionStatement.transform (/Users/ej049491/Documents/infinity/node_modules/systemjs-builder/node_modules/traceur/bin/traceur.js:7419:28) at ParseTreeTransformer.transformAny (/Users/ej049491/Documents/infinity/node_modules/systemjs-builder/node_modules/traceur/bin/traceur.js:9514:44) at ParseTreeTransformer.transformToBlockOrStatement (/Users/ej049491/Documents/infinity/node_modules/systemjs-builder/node_modules/traceur/bin/traceur.js:9538:32) at ParseTreeTransformer.transformIfStatement (/Users/ej049491/Documents/infinity/node_modules/systemjs-builder/node_modules/traceur/bin/traceur.js:9955:29) at IfStatement.transform (/Users/ej049491/Documents/infinity/node_modules/systemjs-builder/node_modules/traceur/bin/traceur.js:7737:28) at ParseTreeTransformer.transformAny (/Users/ej049491/Documents/infinity/node_modules/systemjs-builder/node_modules/traceur/bin/traceur.js:9514:44) at ParseTreeTransformer.transformToBlockOrStatement (/Users/ej049491/Documents/infinity/node_modules/systemjs-builder/node_modules/traceur/bin/traceur.js:9538:32) at ParseTreeTransformer.transformIfStatement (/Users/ej049491/Documents/infinity/node_modules/systemjs-builder/node_modules/traceur/bin/traceur.js:9956:31) at IfStatement.transform (/Users/ej049491/Documents/infinity/node_modules/systemjs-builder/node_modules/traceur/bin/traceur.js:7737:28) at ParseTreeTransformer.transformAny (/Users/ej049491/Documents/infinity/node_modules/systemjs-builder/node_modules/traceur/bin/traceur.js:9514:44) at ParseTreeTransformer.transformList (/Users/ej049491/Documents/infinity/node_modules/systemjs-builder/node_modules/traceur/bin/traceur.js:9521:34) at ParseTreeTransformer.transformFunctionBody (/Users/ej049491/Documents/infinity/node_modules/systemjs-builder/node_modules/traceur/bin/traceur.js:9895:31)

My systemjs config.

http://paste.ofcode.org/jBV9Yu9N5sr5zEufdQNA84

@Gbuomprisco So newest version is working now, i had it looking for dist/index.js (which would cause it to look for dist/dist/ng2-tag-input.bundle.js which does not exist) instead of dist/ng2-tag-input.bundle.js directly. But the builder is giving the exact same error as the other two mentioned on this thread: Error: Multiple anonymous defines

I read similar issues at https://github.com/InfomediaLtd/angular2-materialize/issues/115

It seems like it was fixed by adding "format": "global" to the configuration. I have not encountered this issue, I rarely use SystemJS to be honest. Can you try and let me know if this works?

Thanks!

Adding "format": "global" to the configuration let me build but now I run into runtime errors.

http://paste.ofcode.org/yWYVfePjjpd3CpHRkqQJKv

@TakeN0 Just wondering whether the build worked for you, Im getting runtime error after adding "format":"global". Uncaught TypeError: Cannot read property 'Component' of undefined(…).

@sumitdhameja I am seeing the same behavior you are.

Any news on this?

I am also getting the issue: Cannot read property 'Component' of undefined(…).

Hi everyone,

I was able to make it work with systemjs. Could you try setting format: 'cjs'? Please reopen if still an issue

can confirm format: cjs along with the other instructions on the readme worked. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matthewerwin picture matthewerwin  Â·  5Comments

cyrilrbt picture cyrilrbt  Â·  4Comments

admix picture admix  Â·  5Comments

EnochGao picture EnochGao  Â·  4Comments

Shinzah picture Shinzah  Â·  3Comments