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
After creating a new code-sharing project, ng serve results in an error and the demo is not shown.
From Angular CLI:
ERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'core-js/es7/reflect' in 'C:\git\playground\hello-shared\src'
To Reproduce
Create new code-sharing project with ng new -c=@nativescript/schematics ns-demo --shared.
Run ng serve.
Expected behavior
Creating a new code-sharing project should include all files created in a new 10.1.0 Angular project (ng new). Notably, a .browserslistrc file was not created. Adding this file with the default content will resolve the issue:
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support
# You can see what browsers were selected by your queries by running:
# npx browserslist
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
Before Angular CLI used differential loading (see 1 and 2) a project dependency on core-js was necessary. The expected core-js was ~2.5.0, which provided different paths. The issue can alternatively be fixed by updating the default src/polyfills.ts file: replace import 'core-js/es7/reflect'; with import 'core-js/es/reflect';. This is less preferable than using differential loading by default.
The text was updated successfully, but these errors were encountered:
Environment
Angular CLI: 10.2.0
Node: 14.15.0
OS: win32 x64
Provide the content of the
package.json
file in the project:Describe the bug
After creating a new code-sharing project,
ng serve
results in an error and the demo is not shown.From Angular CLI:
To Reproduce
ng new -c=@nativescript/schematics ns-demo --shared
.ng serve
.Expected behavior
Creating a new code-sharing project should include all files created in a new 10.1.0 Angular project (
ng new
). Notably, a.browserslistrc
file was not created. Adding this file with the default content will resolve the issue:Before Angular CLI used differential loading (see 1 and 2) a project dependency on core-js was necessary. The expected core-js was ~2.5.0, which provided different paths. The issue can alternatively be fixed by updating the default
src/polyfills.ts
file: replaceimport 'core-js/es7/reflect';
withimport 'core-js/es/reflect';
. This is less preferable than using differential loading by default.The text was updated successfully, but these errors were encountered: