Skip to content
This repository was archived by the owner on Oct 26, 2021. It is now read-only.

native-shim cannot be bundled because includes errors #100

Closed
Hotell opened this issue May 28, 2017 · 5 comments
Closed

native-shim cannot be bundled because includes errors #100

Hotell opened this issue May 28, 2017 · 5 comments

Comments

@Hotell
Copy link

Hotell commented May 28, 2017

This is occurring when building app via webpack and uglify

Unexpected token: name (browserConstruction) [../~/source-map-loader!../~/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js:89,0]

https://travis-ci.org/Hotell/skate-starter/builds/236986916#L306

any ideas?

@whyboris
Copy link

whyboris commented Aug 25, 2017

Similar problem on our setup. The app works fine locally, but when the server tries to build (Angular CLI, not explicit webpack config), in its last step:

ERROR in polyfills.f73c9a87ee1979c6555e.bundle.js from UglifyJs
Unexpected token: punc ()) [polyfills.f73c9a87ee1979c6555e.bundle.js:1633,2]

Specifically, the error occurs in:
node_modules/@webcomponents/custom-elements/src/native-shim.js:61,0]
which is simply (() => {

I created an issue with UglifyJs mishoo/UglifyJS#2287
and was told that it's not an UglifyJs issue but an Angular CLI.

I created an issue with the Angular: angular/angular-cli#7509

@whyboris
Copy link

Issue resolved on the Angular CLI issue page: angular/angular-cli#7509
The solution was to bypass uglification by including the script into the angular-cli.json file instead of the polyfils.ts file.

@bicknellr
Copy link
Contributor

Hi, @whyboris, was this specifically an angular-cli issue? Anything on our end that still needs attention?

@whyboris
Copy link

whyboris commented Sep 6, 2017

In my case it was just an angular-cli issue and no work is needed from custom-elements, thank you.
I hope my link to the angular issue will help others who end up running into the same problem 👍

@bicknellr
Copy link
Contributor

Thanks, glad you figured it out! I'll close this bug then.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants