Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ERR_INVALID_STATE.TypeError('Controller is already closed') when executing unit tests in default created project for Angular 20 #30506

Open
@adriangonzalezrodrigo

Description

@adriangonzalezrodrigo

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

Yes

Description

I have updated one of my apps to angular 20 from angular 19.
Now I see that unit tests using karma works but at the end of the execution I see the next error:
node:internal/webstreams/readablestream:1077
throw new ERR_INVALID_STATE.TypeError('Controller is already closed');
^

TypeError [ERR_INVALID_STATE]: Invalid state: Controller is already closed
at ReadableStreamDefaultController.enqueue (node:internal/webstreams/readablestream:1077:13)

I also have updated angular-cli tool and I created a new project from scratch to know if maybe the issue is related with my project. But I have seen that same error appears. Also, I included Stryker in the default created project and this doesn't work (but Stryker is other problem).

Default created project package.json:
{
"name": "ang-20-test",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/common": "^20.0.0",
"@angular/compiler": "^20.0.0",
"@angular/core": "^20.0.0",
"@angular/forms": "^20.0.0",
"@angular/platform-browser": "^20.0.0",
"@angular/router": "^20.0.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.15.0"
},
"devDependencies": {
"@angular/build": "^20.0.1",
"@angular/cli": "^20.0.1",
"@angular/compiler-cli": "^20.0.0",
"@stryker-mutator/core": "^9.0.1",
"@stryker-mutator/karma-runner": "^9.0.1",
"@types/jasmine": "~5.1.0",
"jasmine-core": "~5.7.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"typescript": "~5.8.2"
}
}

I created the project using node 20.19.2. Tested on Macbook Pro 2018 (intel arc)

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw


Please provide the environment you discovered this bug in (run ng version)


Anything else?

No response

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