-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to resolve @nx/webpack:webpack
Error on newly created NX
repository, when invoking npm run start
#16686
Comments
I am also having the same issue with my project. I am using NX for my backend serverless API with NestJS. I was on version
Start migration.... 🚀
These migrations mostly updated the versions of these following NX dependencies
On version
Up until the version 15 my apps were building fine, but after migrating to 16 it started failing for the missing webpack executor/builder. On v16.0.1, it seems the package Contents of {
"executors": {
"webpack": {
"implementation": "@nx/node/src/executors/webpack/webpack.impl",
"schema": "@nx/node/src/executors/webpack/schema.json",
"description": "Build a Node application using Webpack."
},
"node": {
"implementation": "@nx/node/src/executors/node/node.impl",
"schema": "@nx/node/src/executors/node/schema.json",
"description": "Execute a Node application."
}
},
"builders": {
"webpack": {
"implementation": "@nx/node/src/executors/webpack/compat",
"schema": "@nx/node/src/executors/webpack/schema.json",
"description": "Build a Node application using Webpack."
},
"node": {
"implementation": "@nx/node/src/executors/node/compat",
"schema": "@nx/node/src/executors/node/schema.json",
"description": "Execute a Node application."
}
}
} and here is the new {
"executors": {
"node": {
"implementation": "./src/executors/node/node.impl",
"schema": "./src/executors/node/schema.json",
"description": "Execute a Node application."
}
},
"builders": {
"node": {
"implementation": "./src/executors/node/compat",
"schema": "./src/executors/node/schema.json",
"description": "Execute a Node application."
}
}
} Is there anything I'm missing here? Or do we have to migrate to other bundlers for the latest version? Thank you. |
@ognjenjevremovic This should be addressed in the next patch. Looks like we missed it. Thanks for reporting |
As a workaround (until this is fixed in the future releases of
For this scenario, let's choose option 2 by installing Steps on addressing the issue with
$ npm i -D @nx/esbuild@latest
$ npm i -D esbuild@~0.17.5
"build": {
"executor": "@nrwl/esbuild:esbuild",
"outputs": [
"{options.outputPath}"
],
"defaultConfiguration": "production",
"options": {
"platform": "node",
"outputPath": "dist/<name-of-your-project>",
"format": [
"cjs"
],
"bundle": false,
"main": "src/main.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
"src/assets"
],
"generatePackageJson": true,
"esbuildOptions": {
"sourcemap": true,
"outExtension": {
".js": ".js"
}
}
},
"configurations": {
"development": {},
"production": {
"generateLockfile": true,
"esbuildOptions": {
"sourcemap": false,
"outExtension": {
".js": ".js"
}
}
}
}
Note: If you're using a different entrypoint file ( I hope this workaround helps others run their |
@ndcunningham Thanks for your fast reaction on this one. 🚀 I tried installing both I didn't want to rollback to version EditFor tracking the resolution of this issue, follow the #16702. |
After running nx 16 migrations in my existing project, I am now getting:
I upgraded to 16.0.3 but the error persists. The error looks terribly similar to the issue description. Manually installing |
Hello, I have just upgraded to version 16.1.3 and I am still having issues being able to run a nestjs application. I created another nx/nest application to compare the isolated project.json with my existing codebase for a quick fix. There seem to be new properties under targets build:
also the executor for serve is now @nx/js:node while the build should be @nx/webpack:webpack The last property I did not have and copied the file over to my existing app. Running serve:production seems to be working |
…pack giving tons of warnings and ERRORS nrwl/nx#16686 this issue helped, but a fix is who knows when coming. I dont even know if webpack is actually the correct target... Update project.json, .babelrc, project.json, and 2 more files
I'm broken and remedies described like manual install of @nx/webpack is not working. All of this is associated with installing the @mui/x-data-grid module. Before installing everything ran fine. I installed x-data-grid and then got the following when calling npm start: Cannot find module '@nrwl/webpack/package.json'
Then I did what was suggested and did npm install @nx/webpack. Now when I npm start I get the following:
ENOENT: no such file or directory, open 'C:\Users\woodm\source\repository\equesoft\node_modules@nrwl\webpack@nx\webpack\src\executors\dev-server\schema.json' I'm a bit of a novice with Nx. Am I left with the esbuild option to fix this? Does anyone have instructions on what steps I can take to get my project building/running again? I went ahead and did a migrate to 16.0.3 Nx version, then after that ran npm install @nx/webpack and now it's worse. My project has become COMPLETELY BROKEN. This is what I get running npm start... nx run ingateweb:serve:development
Failed tasks:
Hint: run the command with --verbose for more details. How do I resolve this, anyone? |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
I created a new
NX
workspace withnpx create-nx-workspace@latest
command and have selectedStandalone Node app
option withExpress [https://expressjs.com/]
preconfigured.When I try to run the project (after the workspace has been created and all the dependencies have been installed successfully), with no code changes, I am greeted with the error
Unable to resolve @nx/webpack:webpack
.Here's the full log output of the command:
Expected Behavior
I should be able to start the Express server application after a clean
NX
workspace have been created withnpx create-nx-workspace@latest
command.GitHub Repo
https://github.com/ognjenjevremovic/test-express
Steps to Reproduce
Steps to reproduce with the provided repository:
npm ci
),npm run start
or,npx nx serve test-express
.————————————————————————————————————————————————————————————————————————————————————————————————————————————————
Steps to reproduce with the fresh
NX
workspace:NX
workspace (npx create-nx-workspace@latest
),cd
into the directory,npm run start
or,npx nx serve test-express
.Nx Report
Failure Logs
Additional Information
No response
The text was updated successfully, but these errors were encountered: