When I upgraded to ArcGIS API 5.0 (this commit: https://github.com/GeoDaoyu/Chu/commit/4fad0cd6259b2bc442ef1f4d8f5b7bff6dae9be6), a syntax error occurred in dev.
I have identified that the syntax error occurred in the file `node_modules/@arcgis/core/views/SceneView.js`.
So I wrote a script to fix the grammar errors (this commit: https://github.com/GeoDaoyu/Chu/commit/7141fd8159a05befa1aa9d377f1ce0f9c88b81d6). The function of this script is very simple, which is to format the code with prettier. Then dev worked.
I find this issue extremely strange. Why are there syntax error?
Solved! Go to Solution.
This might be related the webpack build. When looking at what is shipped in npm, the `,:` syntax is not there.
https://www.npmjs.com/package/@arcgis/core?activeTab=code
This might be related the webpack build. When looking at what is shipped in npm, the `,:` syntax is not there.
https://www.npmjs.com/package/@arcgis/core?activeTab=code
Thanks for your reply. 🙏
Based on your hint, I continued to debug chainWebpack and found that the error occurred in the compilation.moduleTemplates stage. However, I have no way to handle the Webpack issue. I can only temporarily bypass the error using the prettier method mentioned above.
I can leave the Webpack version: 5.88.2 here. If anyone else encounters this problem, it can be used as a reference.
I wrote a project to reproduce this problem in https://github.com/GeoDaoyu/arcgis-webpack