nitayneeman / schematics-utilities

🛠️ Useful exported utilities for working with Schematics
https://nitayneeman.github.io/schematics-utilities
MIT License
86 stars 9 forks source link

Angular 10: Cannot find module '@schematics/angular/utility/project' #29

Closed mraible closed 4 years ago

mraible commented 4 years ago

I'm using this library as part of @oktadev/schematics. Today, I tried upgrading to Angular 10 and now I get the following stack trace when I try to install my schematic. It seems like the error is caused by this project, but I'm not sure.

Cannot find module '@schematics/angular/utility/project'
Require stack:
- /Users/mraible/ng10/node_modules/@angular/cdk/schematics/utils/build-component.js
- /Users/mraible/ng10/node_modules/@angular/cdk/schematics/utils/index.js
- /Users/mraible/ng10/node_modules/@angular/cdk/schematics/index.js
- /Users/mraible/ng10/node_modules/schematics-utilities/dist/material/ast/ng-module-imports.js
- /Users/mraible/ng10/node_modules/schematics-utilities/dist/material/index.js
- /Users/mraible/ng10/node_modules/schematics-utilities/dist/index.js
- /Users/mraible/ng10/node_modules/@oktadev/schematics/src/add-auth/index.js
- /Users/mraible/ng10/node_modules/@angular-devkit/schematics/tools/export-ref.js
- /Users/mraible/ng10/node_modules/@angular-devkit/schematics/tools/index.js
- /Users/mraible/ng10/node_modules/@angular/cli/utilities/json-schema.js
- /Users/mraible/ng10/node_modules/@angular/cli/models/command-runner.js
- /Users/mraible/ng10/node_modules/@angular/cli/lib/cli/index.js
- /usr/local/lib/node_modules/@angular/cli/lib/init.js
- /usr/local/lib/node_modules/@angular/cli/bin/ng
mraible commented 4 years ago

@nitayneeman Do you have any idea about how to fix this issue?

nitayneeman commented 4 years ago

@nitayneeman Do you have any idea about how to fix this issue?

Hey, It's nice to hear you're using this library for @oktadev/schematics.

Probably the issue is triggered from here: https://github.com/nitayneeman/schematics-utilities/blob/master/src/angular/project.ts#L7

The thing is the following file was removed in v10.0.x: https://github.com/angular/angular-cli/blob/9.1.x/packages/schematics/angular/utility/project.ts

There is a plan to support v10, but I don't have the capacity to support it at the moment... Can you point the last version of @schematics/angular which was ok for you?

mraible commented 4 years ago

I'm currently using v2.0.0 because of this issue with 2.0.1. @oktadev/schematics works great for Angular 9 apps but breaks when trying to run it on Angular 10. Ideally, there's a solution that allows things to continue to work on Angular 9 and works with 10. If I donate $$ to help with this bug fix, would that help accelerate the fix?

nitayneeman commented 4 years ago

I'm currently using v2.0.0 because of this issue with 2.0.1. @oktadev/schematics works great for Angular 9 apps but breaks when trying to run it on Angular 10. Ideally, there's a solution that allows things to continue to work on Angular 9 and works with 10. If I donate $$ to help with this bug fix, would that help accelerate the fix?

Thanks for the offer, but it would still take me time to reach and implement (it means to align all the files to the original source code changes). Maybe would you like to contribute a specific fix quickly - in case you have an idea to suggest?