nxext / nx-extensions-ionic

Nx Extension for Ionic
MIT License
33 stars 9 forks source link

Capacitor generator fails with Nx v19.8.0 #41

Closed edbzn closed 1 month ago

edbzn commented 1 month ago

Describe the bug

Running npx nx generate @nxtend/capacitor:capacitor-project --project test-app --verbose to add Capacitor to an existing project fails with a fresh new workspace.

 NX  Generating @nxtend/capacitor:capacitor-project

✔ What app ID would you like to use? · io.ionic.starter
✔ What app name would you like to use? · test

 NX   (0 , workspaces_1.buildWorkspaceConfigurationFromGlobs) is not a function

TypeError: (0 , workspaces_1.buildWorkspaceConfigurationFromGlobs) is not a function
    at readRawWorkspaceJson (/xxx/node_modules/@nxtend/capacitor/node_modules/@nrwl/devkit/src/generators/project-configuration.js:308:87)
    at inlineProjectConfigurationsWithTree (/xxx/node_modules/@nxtend/capacitor/node_modules/@nrwl/devkit/src/generators/project-configuration.js:260:27)
    at readWorkspace (/xxx/node_modules/@nxtend/capacitor/node_modules/@nrwl/devkit/src/generators/project-configuration.js:248:27)
    at readProjectConfiguration (/xxx/node_modules/@nxtend/capacitor/node_modules/@nrwl/devkit/src/generators/project-configuration.js:154:23)
    at normalizeOptions (/xxx/node_modules/@nxtend/capacitor/src/generators/capacitor-project/lib/normalize-options.js:8:63)
    at /xxx/node_modules/@nxtend/capacitor/src/generators/capacitor-project/generator.js:14:76
    at Generator.next (<anonymous>)
    at /xxx/node_modules/tslib/tslib.js:169:75
    at new Promise (<anonymous>)
    at __awaiter (/xxx/node_modules/tslib/tslib.js:165:16)

To Reproduce Steps to reproduce the behavior:

npx create-nx-workspace --preset="angular-monorepo" --appName="test-app" --name="repro" --interactive="false" --nxCloud="skip"
cd repro
npm install --save-dev --exact @nxtend/capacitor --force
npx nx build test-app
npx nx generate @nxtend/capacitor:capacitor-project --project test-app --verbose

Expected behavior

The generator should run successfully with a fresh new Nx workspace.

Additional context N/A

edbzn commented 1 month ago

It turns out I was using the old Nxtend package instead of Nxext. :sweat_smile: