Skip to content

__NG_CLI_RESOURCE__0 is not defined #19586

@AColombel

Description

@AColombel

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Yes, the previous version in which this bug was not present was: 10.1.0

Description

When i use npm test, i got an error since i updated my Angular project from 10.1.0 (with ng update) to 11.0.4.

🔬 Minimal Reproduction

my tsconfig.spec.ts :
{ "compilerOptions": { "outDir": "./out-tsc/spec", "types": [ "jasmine", "node" ], "experimentalDecorators": true, "emitDecoratorMetadata": true, "baseUrl": "./", "lib": [ "es2020" ] }, "files": [ "src/test.ts", "src/polyfills.ts" ], "include": [ "src/**/*.spec.ts", "src/**/*.d.ts" ] }

🔥 Exception or Error

Chrome Headless 87.0.4280.88 (Windows 10) ERROR An error was thrown in afterAll Uncaught ReferenceError: __NG_CLI_RESOURCE__0 is not defined ReferenceError: __NG_CLI_RESOURCE__0 is not defined at http://localhost:9876/_karma_webpack_/main.js:67636:15 at Object.Sy1n (http://localhost:9876/_karma_webpack_/main.js:67641:2) at __webpack_require__ (http://localhost:9876/_karma_webpack_/webpack:/webpack/bootstrap:79:1) at Object.eQIV (http://localhost:9876/_karma_webpack_/webpack:/src/app/app.component.spec.ts:6:1) at __webpack_require__ (http://localhost:9876/_karma_webpack_/webpack:/webpack/bootstrap:79:1) at webpackContext (http://localhost:9876/_karma_webpack_/webpack:/src sync \.spec\.ts$:73:1) at Array.map (<anonymous>) at Object.CB3P (http://localhost:9876/_karma_webpack_/main.js:30637:16) at __webpack_require__ (http://localhost:9876/_karma_webpack_/webpack:/webpack/bootstrap:79:1) at checkDeferredModules (http://localhost:9876/_karma_webpack_/webpack:/webpack/bootstrap:45:1)

🌍 Your Environment

tsconfig.spec.ts :
{ "compilerOptions": { "outDir": "./out-tsc/spec", "types": [ "jasmine", "node" ], "experimentalDecorators": true, "emitDecoratorMetadata": true, "baseUrl": "./", "lib": [ "es2020" ] }, "files": [ "src/test.ts", "src/polyfills.ts" ], "include": [ "src/**/*.spec.ts", "src/**/*.d.ts" ] }

Anything else relevant?
I read this issue : #18718
but i'm a student, and i just need some help to understand the issue (and fix it for my end year project)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions