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

'ng build --prod' failing with es5 as target #7303

Closed
joshhobson opened this issue Aug 8, 2017 · 4 comments
Closed

'ng build --prod' failing with es5 as target #7303

joshhobson opened this issue Aug 8, 2017 · 4 comments

Comments

@joshhobson
Copy link

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

1.2.7
Also seen on 1.2.1 before I updated in an attempt to fix

Repro steps.

ng build --prod

The log given by the failure.

ERROR in vendor.749569c349ba199c26dd.bundle.js from UglifyJs
Unexpected token: name (Decoder) [vendor.749569c349ba199c26dd.bundle.js:26296,6]

I know there are many issues similar to this but I have been unable to fix it using the suggestions. I have tried setting my target to 'es5' and this doesn't help. The UglifyJSWebpackPlugin fix doesn't seem to be possible without configuring the build completely myself.

I should note, where ever this Decoder class is coming from, it's not in code I've written (which seems to make sense given it's in vendor) and I have no way to find out where it is coming from. It may well be an unused library but it's tricky to track down (a quick grep shows at least 5 "Decoder" classes in my node_modules".

@Brocco Brocco added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity3: broken labels Aug 18, 2017
@filipesilva filipesilva added type: RFC / discussion / question and removed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity3: broken labels Aug 21, 2017
@filipesilva
Copy link
Contributor

One of your third party libraries is shipping es6+ code, but we don't support building that at the moment (#2907).

It's not very easy to track it down because that code just breaks the build process. My advice is to do ng serve (without --prod) instead and search the vendor bundle (with sourcemaps) for a third party lib that has (Decoder).

@AmitMY
Copy link
Contributor

AmitMY commented Sep 24, 2017

This is still not supported, but just for tracking it down, I recommend doing ng build --prod --sourcemap - that will give you the exact location of the error

@joshhobson
Copy link
Author

Fantastic, thanks @AmitMY. Just in case anyone hits the same issue, I found the culprit: the cbor library required by autobahn.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants