When running the react-standalone application, after generating a library using npx nx g lib mylib --directory=mylib and selecting vite as bundler, the command npm run start fails with the following error: Unable to create nodes for mylib/vite.config.ts using plugin @nx/vite/plugin.. Im not seeing a similar error when i use rollup instead.
Go to your nx-recipes repo, under react-standalone
npm i
npx nx g lib mylib --directory=mylib
select react lib option
select vite as bundler
select first option (as provided option) for naming
npm run start
Nx Report
me@me-MBP ~me/test/nx-recipes/react-standalone main ± npm run start
> @myreactapp/source@0.0.0 start
> nx serve
NX Unable to create nodes for mylib/vite.config.ts using plugin @nx/vite/plugin.
Inner Error: Error: Cannot find module 'ajv/dist/core'
Require stack:
- /Users/me/test/nx-recipes/react-standalone/node_modules/ajv-draft-04/dist/index.js
- /Users/me/test/nx-recipes/react-standalone/node_modules/@microsoft/api-extractor/node_modules/@rushstack/node-core-library/lib/JsonSchema.js
- /Users/me/test/nx-recipes/react-standalone/node_modules/@microsoft/api-extractor/node_modules/@rushstack/node-core-library/lib/index.js
- /Users/me/test/nx-recipes/react-standalone/node_modules/@microsoft/api-extractor/lib/api/CompilerState.js
- /Users/me/test/nx-recipes/react-standalone/node_modules/@microsoft/api-extractor/lib/index.js
- /Users/me/test/nx-recipes/react-standalone/node_modules/vite-plugin-dts/dist/index.cjs
- /Users/me/test/nx-recipes/react-standalone/mylib/vite.config.ts
- /Users/me/test/nx-recipes/react-standalone/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
at Function.Module._load (node:internal/modules/cjs/loader:986:27)
at Module.require (node:internal/modules/cjs/loader:1233:19)
at require (node:internal/modules/helpers:179:18)
at Object.<anonymous> (/Users/will/zen/test/nx-recipes/react-standalone/node_modules/ajv-draft-04/src/index.ts:2:1)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Object._require.extensions.<computed> [as .js] (file:///Users/will/zen/test/nx-recipes/react-standalone/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:68404:17)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Function.Module._load (node:internal/modules/cjs/loader:1024:12)
at Module.require (node:internal/modules/cjs/loader:1233:19)
at require (node:internal/modules/helpers:179:18)
at Object.<anonymous> (/Users/will/zen/test/nx-recipes/react-standalone/node_modules/@microsoft/api-extractor/node_modules/@rushstack/node-core-library/src/JsonSchema.ts:11:1)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Object._require.extensions.<computed> [as .js] (file:///Users/will/zen/test/nx-recipes/react-standalone/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:68404:17)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Function.Module._load (node:internal/modules/cjs/loader:1024:12)
at Module.require (node:internal/modules/cjs/loader:1233:19)
at require (node:internal/modules/helpers:179:18)
at Object.<anonymous> (/Users/will/zen/test/nx-recipes/react-standalone/node_modules/@microsoft/api-extractor/node_modules/@rushstack/node-core-library/src/index.ts:66:1)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
Because of the error the Nx daemon process has exited. The next Nx command is going to restart the daemon process.
If the error persists, please run "nx reset".
Current Behavior
When running the
react-standalone
application, after generating a library usingnpx nx g lib mylib --directory=mylib
and selectingvite
as bundler, the commandnpm run start
fails with the following error:Unable to create nodes for mylib/vite.config.ts using plugin @nx/vite/plugin.
. Im not seeing a similar error when i use rollup instead.Expected Behavior
the application should still be able to run
GitHub Repo
https://github.com/nrwl/nx-recipes/tree/main/react-standalone
Steps to Reproduce
react-standalone
npm run start
Nx Report
Failure Logs
No response
Package Manager Version
10.5.2
Operating System
Additional Information
No response