SoCreate / angular-playground

A drop in app module for working on Angular components in isolation (Angular version 2.x and above).
http://www.angularplayground.it
MIT License
458 stars 62 forks source link

Can't resolve 'core-js/proposals/reflect-metadata' in Angular 13 #291

Closed DanWahlin closed 2 years ago

DanWahlin commented 2 years ago

Versions

8.2.0
Angular CLI: 13.0.2
Node: 14.18.0
Package Manager: npm 6.14.15
OS: darwin x64

Angular: 13.0.1
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1300.2
@angular-devkit/build-angular   13.0.2
@angular-devkit/core            13.0.2
@angular-devkit/schematics      13.0.2
@angular/cli                    13.0.2
@schematics/angular             13.0.2
rxjs                            6.6.7
typescript                      4.4.4

Repro steps

Observed Behavior

[ng serve]: Error: Module not found: Error: Can't resolve 'core-js/proposals/reflect-metadata' in '/Users/danwahlin/Dropbox/Projects/GitHub/Angular-JumpStart'

Full output:

Successfully compiled sandbox files.
[ng serve]: - Generating browser application bundles (phase: setup)...

[ng serve]: ✔ Browser application bundle generation complete.

[ng serve]: 
Initial Chunk Files                                                                            | Names         |      Size
vendor.js                                                                                      | vendor        |   3.50 MB
polyfills.js                                                                                   | polyfills     | 434.25 kB
styles.css, styles.js                                                                          | styles        | 212.41 kB
runtime.js                                                                                     | runtime       |  12.80 kB
main.js                                                                                        | main          |   8.43 kB

| Initial Total |   4.16 MB

Lazy Chunk Files                                                                               | Names         |      Size
default-src_app_core_core_module_ts-src_app_shared_mocks_ts-src_app_shared_shared_module_ts.js | -             | 468.26 kB
default-node_modules_angular_router_fesm2020_testing_mjs.js                                    | -             |  26.93 kB
common.js                                                                                      | common        |  15.09 kB
default-node_modules_tslib_tslib_es6_js.js                                                     | -             |  13.70 kB
src_app_customers_customers_component_sandbox_ts.js                                            | -             |  12.66 kB
src_app_shared_map_map_component_ts.js                                                         | -             |  10.38 kB
src_app_customer_customer-details_customer-details_component_sandbox_ts.js                     | -             |  10.11 kB
src_app_customer_customer-orders_customer-orders_component_sandbox_ts.js                       | -             |   7.39 kB
src_app_about_about_component_sandbox_ts.js                                                    | -             |   4.40 kB
s
[ng serve]: rc_app_customers_customers-card_customers-card_component_sandbox_ts.js                        | -             |   2.81 kB
src_app_customers_customers-grid_customers-grid_component_sandbox_ts.js                        | -             |   2.81 kB

Build at: 2021-11-12T17:03:07.280Z - Hash: d68fa2b8dea5e622 - Time: 11772ms

[ng serve]: 
Error: Module not found: Error: Can't resolve 'core-js/proposals/reflect-metadata' in '/Users/danwahlin/Dropbox/Projects/GitHub/Angular-JumpStart'

[ng serve]: 
** Angular Live Development Server is listening on 127.0.0.1:4201, open your browser on http://127.0.0.1:4201/ **

[ng serve]: 
✖ Failed to compile.

Desired Behavior

Successful build and ability to run Angular Playground

Any other details that may be useful (optional)

I just updated the project to Angular 13 using ng update @angular/cli @angular/core angular-playground.

I tried deleting and reinstalling node_modules just to see if it made a difference but still get the same error. core-js version in the project is 2.5.4.

lurock commented 2 years ago

@DanWahlin I removed 'core-js' from your package.json and references to it in your pollyfills.ts file. I then removed all the node-modules and reinstalled them. I was then able to run playground with no issues. I am not sure if you need 'core-js' for something but it is not in a default angular project.

DanWahlin commented 2 years ago

Thanks @lurock! I suspect that was left over from older versions but didn't think to remove it. That project started with AngularJS and has been migrated to each version over the years. :-) Thanks again.