You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ng build fails in esbuild optimization with ERROR: Expected identifier but found "=" #23842
Thanks for checking. I couldn't figure out how to get the relevant line to display. Where did you get the relevant file from?
I tried going through the file (with the same name in dist) when optimization was disabled, but it showed very different code for the logged line number. Also building with optimization-disabled and then manually running the file through esbuild worked without errors, which confused me a bit...
Thanks for checking. I couldn't figure out how to get the relevant line to display. Where did you get the relevant file from?
I used the debugger to check the file since it was in memory.
I tried going through the file (with the same name in dist) when optimization was disabled, but it showed very different code for the logged line number. Also building with optimization-disabled and then manually running the file through esbuild worked without errors, which confused me a bit...
How you managed this? As when optimizations (ng b --no-optimization) are disabled the build fails and the files are not emitted to disk.
The previous cli version used to also log the file that's throwing the error (so it was easier so set a breakpoint), will also try to find the correct point in code... 😕
It appears that during the packages install I was not using the lock file which ended up installing more recent versions of @stacks/ which ended up causing more errors as shown above.
At this stage the files are already bundle and processed by Webpack and hence the Angular CLI cannot easily print the original file that is causing the problem.
Here is the problematic line, this is generated by Webpack.
Activity
alan-agius4 commentedon Sep 1, 2022
Esbuild is doing the right thing here as indeed the bundle contains invalid syntax.
Webpack is generating wrong code and it a result of the large number of errors in the compilation.
Closing as this is not actionable and the error is expected since the inputted JavaScript has errors.
janniks commentedon Sep 2, 2022
Thanks for checking. I couldn't figure out how to get the relevant line to display. Where did you get the relevant file from?
I tried going through the file (with the same name in
dist) when optimization was disabled, but it showed very different code for the logged line number. Also building with optimization-disabled and then manually running the file through esbuild worked without errors, which confused me a bit...alan-agius4 commentedon Sep 2, 2022
I used the debugger to check the file since it was in memory.
How you managed this? As when optimizations (
ng b --no-optimization) are disabled the build fails and the files are not emitted to disk.janniks commentedon Sep 2, 2022
The previous cli version used to also log the file that's throwing the error (so it was easier so set a breakpoint), will also try to find the correct point in code... 😕
I disabled through the
angular.jsonfile:Just tested again and it doesn't throw the same error, but something like
Error: bundle initial exceeded maximum budget.(but thedistis written)alan-agius4 commentedon Sep 2, 2022
It appears that during the packages install I was not using the lock file which ended up installing more recent versions of
@stacks/which ended up causing more errors as shown above.At this stage the files are already bundle and processed by Webpack and hence the Angular CLI cannot easily print the original file that is causing the problem.
Here is the problematic line, this is generated by Webpack.
It does appear that the problem is caused by the following lines:
janniks commentedon Sep 2, 2022
Interesting thanks! I'll look into it. I also managed to run
buildwith debugger breakpoint now and inspect in-memory info 👍janniks commentedon Sep 2, 2022
Thanks for finding that line — helped a bunch! ✅ Issue resolved
angular-automatic-lock-bot commentedon Oct 3, 2022
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.