NativeScript / nx

NativeScript for Nx.
Other
61 stars 15 forks source link

Does not work with Nx 15 #59

Closed Cselt closed 1 year ago

Cselt commented 1 year ago

Hi,

looks like this plugin is incompatible with latest Nx version. I tried to create a new repository and got an error when I wanted to generate an application.

Steps to reproduce:

> yarn create nx-workspace --cli=nx --preset=empty --packageManager=yarn

yarn create v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "create-nx-workspace@15.0.13" with binaries:
      - create-nx-workspace
[#######################################################################################################] 103/103
 >  NX   Let's create a new workspace [https://nx.dev/getting-started/intro]

√ Repository name                       · sample-app
√ Enable distributed caching to make your CI faster · No

 >  NX   Nx is creating your v15.0.13 workspace.

   To make sure the command works reliably in all environments, and that the preset is applied correctly,
   Nx will run "yarn install" several times. Please wait.

✔ Installing dependencies with yarn
✔ Nx has successfully created the workspace: samő-app.

 >  NX   Successfully initialized git.

 ———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  NX   First time using Nx? Check out this interactive Nx tutorial.

   https://nx.dev/core-tutorial/01-create-blog

Done in 39.08s.

> cd sample-app
> yarn add -D @nativescript/nx
yarn add v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Saved lockfile.
success Saved 17 new dependencies.
info Direct dependencies
└─ @nativescript/nx@4.0.2
info All dependencies
├─ @angular-devkit/architect@0.1400.7
├─ @angular-devkit/core@14.2.9
├─ @angular-devkit/schematics@14.2.9
├─ @nativescript/nx@4.0.2
├─ clone@1.0.4
├─ defaults@1.0.4
├─ is-interactive@1.0.0
├─ log-symbols@4.1.0
├─ magic-string@0.26.2
├─ ora@5.4.1
├─ plist@3.0.6
├─ punycode@2.1.1
├─ sax@1.2.4
├─ sourcemap-codec@1.4.8
├─ wcwidth@1.0.1
├─ xml2js@0.4.23
└─ xmlbuilder@15.1.1
Done in 6.71s.

> yarn nx g @nativescript/nx:app app
yarn run v1.22.17
$ W:\Workspace\sample-app\node_modules\.bin\nx g @nativescript/nx:app app

>  NX  Generating @nativescript/nx:application

√ What frontend framework would you like to use with this NativeScript app? · angular
TypeError: Cannot read properties of undefined (reading 'extends')
    at globForProjectFiles (W:\Workspace\sample-app\node_modules\nx\src\config\workspaces.js:515:16)
    at readWorkspaceJsonFile (W:\Workspace\sample-app\node_modules\nx\src\adapter\ngcli-adapter.js:151:85)
    at SwitchMapSubscriber.project (W:\Workspace\sample-app\node_modules\nx\src\adapter\ngcli-adapter.js:179:105)
    at SwitchMapSubscriber._next (W:\Workspace\sample-app\node_modules\rxjs\internal\operators\switchMap.js:47:27)
    at SwitchMapSubscriber.Subscriber.next (W:\Workspace\sample-app\node_modules\rxjs\internal\Subscriber.js:66:18)
    at MapSubscriber._next (W:\Workspace\sample-app\node_modules\rxjs\internal\operators\map.js:55:26)
    at MapSubscriber.Subscriber.next (W:\Workspace\sample-app\node_modules\rxjs\internal\Subscriber.js:66:18)
    at MapSubscriber._next (W:\Workspace\sample-app\node_modules\rxjs\internal\operators\map.js:55:26)
    at MapSubscriber.Subscriber.next (W:\Workspace\sample-app\node_modules\rxjs\internal\Subscriber.js:66:18)
    at Observable._subscribe (W:\Workspace\sample-app\node_modules\@angular-devkit\core\node\host.js:154:17)

 >  NX   Cannot read properties of undefined (reading 'extends')

   Pass --verbose to see the stacktrace.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

When I used Nx version 14 everything worked just fine.

npx create-nx-workspace@14.8.6 --cli=nx --preset=empty --packageManager=yarn