trellisorg / platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot migrate the library

krstns opened this issue · comments

Hi, when migrating the library with nx 13.10.3 I receive the following:

nx g @trellisorg/make-buildable:migrate
✔ What project would you like to migrate · auth-lib
✔ What kind of library is this? · angular
✔ If this is an Angular lib, what configurations would you like to create? (separated by a comma) · production,development
TypeError: (0 , workspace_1.offsetFromRoot) is not a function
    at normalizeOptions (/Users/krystian/Downloads/notus-angular-main/node_modules/@trellisorg/make-buildable/src/schematics/make-buildable/schematic.js:47:116)
    at /Users/krystian/Downloads/notus-angular-main/node_modules/@trellisorg/make-buildable/src/schematics/make-buildable/schematic.js:109:35
    at MergeMapSubscriber.project (/Users/krystian/Downloads/notus-angular-main/node_modules/@angular-devkit/schematics/src/rules/call.js:75:24)
    at MergeMapSubscriber._tryNext (/Users/krystian/Downloads/notus-angular-main/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/operators/mergeMap.js:67:27)
    at MergeMapSubscriber._next (/Users/krystian/Downloads/notus-angular-main/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/operators/mergeMap.js:57:18)
    at MergeMapSubscriber.Subscriber.next (/Users/krystian/Downloads/notus-angular-main/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/Subscriber.js:66:18)
    at Observable._subscribe (/Users/krystian/Downloads/notus-angular-main/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/util/subscribeToArray.js:5:20)
    at Observable._trySubscribe (/Users/krystian/Downloads/notus-angular-main/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/Observable.js:44:25)
    at Observable.subscribe (/Users/krystian/Downloads/notus-angular-main/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/Observable.js:30:22)
    at MergeMapOperator.call (/Users/krystian/Downloads/notus-angular-main/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/operators/mergeMap.js:37:23)
(0 , workspace_1.offsetFromRoot) is not a function

I am no t entirely sure what's the problem.

Hey thanks for reporting! My guess is something has changed in how Nx does stuff with a newer version, this schematic was originally written for like Nx 9 or something like that. I'll see if I can track down the issue when I have some time!

This seems to be fixed in the code, but has not been released to npm yet.
The issue was that the "offsetFromRoot" function needs to be imported from a different package than previously. Seems 3944352 did this.
@yharaskrik could we get the fixed version released to npm?

This problem persist on @trellisorg/make-buildable v0.0.12

nx g @trellisorg/make-buildable:migrate

> NX  Generating @trellisorg/make-buildable:migrate

? What project would you like to migrate … 
✔ What project would you like to migrate · client-web-app-dashboard-compliance-features-test-summary
✔ What kind of library is this? · angular
✔ If this is an Angular lib, what configurations would you like to create? (separated by a comma) · development
TypeError: (0 , workspace_1.readNxJson) is not a function
    at /Users/joffreyhernandez/Repository/Inferensia/kantik/node_modules/@trellisorg/make-buildable/src/schematics/make-buildable/schematic.js:109:53
    at callRuleAsync (/Users/joffreyhernandez/Repository/Inferensia/kantik/node_modules/@angular-devkit/schematics/src/rules/call.js:78:24)
    at /Users/joffreyhernandez/Repository/Inferensia/kantik/node_modules/@angular-devkit/schematics/src/rules/call.js:73:40
    at Observable._subscribe (/Users/joffreyhernandez/Repository/Inferensia/kantik/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/observable/defer.js:10:21)
    at Observable._trySubscribe (/Users/joffreyhernandez/Repository/Inferensia/kantik/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/Observable.js:44:25)
    at Observable.subscribe (/Users/joffreyhernandez/Repository/Inferensia/kantik/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/Observable.js:30:22)
    at MapOperator.call (/Users/joffreyhernandez/Repository/Inferensia/kantik/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/operators/map.js:32:23)
    at Observable.subscribe (/Users/joffreyhernandez/Repository/Inferensia/kantik/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/Observable.js:25:31)
    at Object.innerSubscribe (/Users/joffreyhernandez/Repository/Inferensia/kantik/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/innerSubscribe.js:102:23)
    at MergeMapSubscriber._innerSub (/Users/joffreyhernandez/Repository/Inferensia/kantik/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/operators/mergeMap.js:80:50)

Nx report:

>  NX   Report complete - copy this into the issue template

   Node : 16.13.0
   OS   : darwin arm64
   yarn : 1.22.19
   
   nx : 15.4.5
   @nrwl/angular : 15.4.5
   @nrwl/cypress : 15.4.5
   @nrwl/detox : Not Found
   @nrwl/devkit : 15.4.5
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 15.4.5
   @nrwl/expo : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : 15.4.5
   @nrwl/js : 15.4.5
   @nrwl/linter : 15.4.5
   @nrwl/nest : 15.4.5
   @nrwl/next : Not Found
   @nrwl/node : 15.4.5
   @nrwl/nx-cloud : 15.0.2
   @nrwl/nx-plugin : 15.4.5
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/rollup : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : Not Found
   @nrwl/web : Not Found
   @nrwl/webpack : 15.4.5
   @nrwl/workspace : 15.4.5
   @nrwl/vite : Not Found
   typescript : 4.8.4