2

When I try to production build angular, i encountered the error 'Unexpected character '@' [scripts.*.js]'. Production command ng build --prod

Angular version: 7.* Node modules used : 1. ag-grid

1
  • Can you take a screen shot Commented Jun 20, 2019 at 9:26

2 Answers 2

3

When anyone gets the error 'Unexpected character '@' [scripts..js]' or 'Unexpected token ',' [scripts..js]'. The above error could be from our code or the node_modules which we would have installed.

Error : You can see the error here

To find the source, execute the command ng build --prod --source-map

After executing source map, we can get the source file that causes error

enter image description here

The above command would point us to the file that causes the error while taking a production build.

If the command doesn't point to the source, please ensure that sourcemap=true in angular.json for production is true

Sign up to request clarification or add additional context in comments.

Comments

0

this error occurs for eg. if you accidentally have a css-file in the scripts section in the angular.json

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.