salesforce / akita

🚀 State Management Tailored-Made for JS Applications
https://salesforce.github.io/akita/
Apache License 2.0
3.7k stars 342 forks source link

Angular schematics bug #1057

Closed michaelmarcuccio closed 1 year ago

michaelmarcuccio commented 1 year ago

Is this a regression?

Yes

Description

With Akita installed, can no longer use Angular schematics. i.e.

ng g c test
An unhandled exception occurred: Package "@datorama/akita" was found but does not support schematics.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

[error] Error: Package "@datorama/akita" was found but does not support schematics.
    at SchematicEngineHost.resolve (\node_modules\@angular-devkit\schematics\tools\node-module-engine-host.js:53:23)
    at SchematicEngineHost._resolveCollectionPath (\node_modules\@angular-devkit\schematics\tools\node-module-engine-host.js:80:37)
    at SchematicEngineHost.createCollectionDescription (\node_modules\@angular-devkit\schematics\tools\file-system-engine-host-base.js:118:27)
    at SchematicEngine._createCollectionDescription (\node_modules\@angular-devkit\schematics\src\engine\engine.js:162:40)
    at SchematicEngine.createCollection (\node_modules\@angular-devkit\schematics\src\engine\engine.js:155:43)
    at GenerateCommandModule.getSchematics (\node_modules\@angular\cli\src\commands\generate\cli.js:136:48)
    at async GenerateCommandModule.getSchematicsToRegister (\node_modules\@angular\cli\src\commands\generate\cli.js:176:76)
    at async GenerateCommandModule.builder (\node_modules\@angular\cli\src\commands\generate\cli.js:35:55)
    at async runCommand (\node_modules\@angular\cli\src\command-builder\command-runner.js:113:5)
    at async default_1 (\node_modules\@angular\cli\lib\cli\index.js:70:16)

Please provide the environment you discovered this bug in

Akita:
"@datorama/akita": "8.0.1"
"@datorama/akita-ng-entity-service": "8.0.0"

"@datorama/akita-ng-router-store": "8.0.0"
"@datorama/akita-ngdevtools": "7.0.0"

Angular CLI: 15.1.5
Node: 16.16.0
Package Manager: npm 8.19.2
OS: win32 x64

@angular-devkit/architect       0.1501.5
@angular-devkit/build-angular   15.1.5
@angular-devkit/core            15.1.5
@angular-devkit/schematics      15.1.5
@angular/cli                    15.1.5
@schematics/angular             15.1.5
rxjs                            7.8.0
typescript                      4.9.5

Anything else?

Several people are having the same issue in the latest posts: https://app.gitter.im/#/room/#akita-state-management_Lobby:gitter.im/$GLtaqX5Lik92zSF4S15Aw_EZL_6COjY07xjDmNTOetQ

Do you want to create a pull request?

No

brice-noowu commented 1 year ago

Same problem here

michaelmarcuccio commented 1 year ago

Workaround/Resolution: Remove "@datorama/akita" from angular.json "schematicCollections".

Den-dp commented 1 year ago

Unfortunately, akita's schematics were deprecated in 8.0.0 https://github.com/salesforce/akita/blob/master/packages/akita/CHANGELOG.md#800-2023-01-09

Removing "@datorama/akita" from "schematicCollections" of angular.json should help

Donnerstagnacht commented 1 year ago

Same issue. But in my case it was called "defaultCollection": "@datorama/akita". Does that make a difference?