Open macjohnny opened 4 years ago
I just had the same issue but I wasn't sure if the NativeScript mobile part of the shared app needs the "noEmitHelpers": true,
so instead I put "noEmitHelpers": false,
into the "tsconfig.app.json" file so it would only affect the typescript compiler options of the web browser portion of the project which also fixed this issue.
For my newly created code-sharing Angular project, ng serve
first gave me
ERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'core-js/es7/reflect' in ...
which I resolved by editing polyfills.ts
to have import 'core-js/es/reflect';
instead of import 'core-js/es7/reflect';
. (Note: my package.json has "core-js": "^3.6.0",
.)
After that change, I now got Uncaught ReferenceError: __decorate is not defined
, which was resolved as discussed above. After both changes, the demo app ran as expected.
EDIT:
I opened #306 regarding the polyfills error. The better fix is actually to add the missing .browserslistrc
file.
Environment Provide the content of the
package.json
file in the project:Describe the bug When starting the newly created app, the error
Uncaught ReferenceError: __decorate is not defined
occurs in the browser and the app crashes.To Reproduce
Expected behavior No error
Additional context The solution is to remove the following lines from the
tsconfig.json
:(Credits: https://stackoverflow.com/a/64088843)