After upgrading Angular from version 12 to 13, I encountered an error when running the app: "Uncaught SyntaxError: Unexpected token 'export'." Here are some additional details for context:
In the angular.json configuration file, I had specified the following entry in the scripts section:
"./node_modules/@angular/core/bundles/core.umd.js"
However, after updating to Angular 13, I noticed that instead of UMD JS files, we now have .mjs files located at:
"./node_modules/@angular/core/esm2020/core.mjs".
Note: The error originates from scripts.js and specifically points to the line "export * from './index';" (which is found in the core.mjs file).
If anyone has faced this issue before and knows a solution, please share.
I attempted adding "module" type in the main package.json file, but the problem persists.