Comments (11)
@SirPhemmiey i cannot provide the repo as itβs private.
But I had previously experienced this error message because I was not setting the webpack plugins outputPath in my project json
I can give you an example of a working config later
from nx.
@dan-cooke can you provide the github project for us to compare? and what do you mean by "setting out path correctly">
from nx.
Hi,
Any update on this ?
from nx.
Hello, any update on this, please?
from nx.
I cannot reproduce this, I am using generate package successfully in my project. Check you guys are setting out path correctly
from nx.
@dan-cooke i would highly appreciate it, thank you.
from nx.
Hi @dan-cooke , could you provide the configuration example you mentioned in your last comment?
from nx.
{
"name": "api",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/api/src",
"projectType": "application",
"targets": {
"build": {
"executor": "@nx/webpack:webpack",
"options": {
"webpackConfig": "apps/api/webpack.config.js",
"outputPath": "dist/apps/api"
}
}
}
const { NxWebpackPlugin } = require('@nx/webpack');
const { join } = require('path');
module.exports = {
output: {
path: join(__dirname, '../../dist/apps/api'),
},
plugins: [
new NxWebpackPlugin({
target: 'node',
compiler: 'tsc',
main: './src/main.ts',
tsConfig: './tsconfig.app.json',
generatePackageJson: true,
transformers: [
{
name: '@nestjs/swagger/plugin',
options: {
introspectComments: true,
},
},
],
assets: ['./src/assets'],
optimization: false,
outputHashing: 'none',
}),
],
};
Works for me
I can post a min repro someday soon, but have you made sure you are not running with the nx cache? I always run my builds with --skipNxCache
because i've found it to be stale most of the time
Edit: Just realised im missing outputPath, I added that in and it still works
Node : 20.9.0
OS : linux-x64
yarn : 1.22.22
nx (global) : 18.0.8
nx : 18.0.6
@nx/js : 18.0.6
@nx/jest : 18.0.6
@nx/linter : 18.0.6
@nx/eslint : 18.0.6
@nx/workspace : 18.0.6
@nx/cypress : 18.0.6
@nx/devkit : 18.0.6
@nx/esbuild : 18.0.6
@nx/eslint-plugin : 18.0.6
@nx/nest : 18.0.6
@nx/node : 18.0.6
@nx/react : 18.0.6
@nrwl/tao : 18.0.6
@nx/vite : 18.0.6
@nx/web : 18.0.6
@nx/webpack : 18.0.6
typescript : 5.3.3
---------------------------------------
Community plugins:
@nx-extend/shadcn-ui : 1.0.0
from nx.
Hi @dan-cooke,
Thanks. Testing it...
from nx.
I'm not sure if this helps but I ran into this issue with an application that was using TSC that was importing a SWC library with a custom executor I wrote to generate the application's package json since it couldn't use esbuild or webpack.
My executor looked like this
// The call to getHelperDependenciesFromProjectGraph was failing
const helperDependencies = getHelperDependenciesFromProjectGraph(
context.root,
context.projectName!,
context.projectGraph!
);
const packageJson = createPackageJson(context.projectName!, context.projectGraph!, {
target: context.targetName,
root: context.root,
isProduction: true,
helperDependencies: helperDependencies.map((dep) => dep.target),
});
Removing the function call getHelperDependenciesFromProjectGraph
and passing in an empty array for helperDependencies alleviated the issue for that application
from nx.
This issue has been resolved and therefore I'm going to close it.
Thanks everyone for weighing in!
from nx.
Related Issues (20)
- Next Js does not pick correct .env file
- When using Bun and building within Dockerfile - 'Failed to process project graph. Run "nx reset" to fix this.' re: 'nx/js/dependencies-and-lockfile' HOT 10
- When using Bun and building in containers, respect the yarn.lock file HOT 4
- When using Bun, 'nx migrate --run-migrations' adds a package-lock.json and does not respect bun.lockb HOT 5
- NX generator display too many cmd windows in windows os HOT 3
- Performance regression in 18.x; plugins being (re)loaded repeatedly HOT 3
- Cannot find configuration for task when upgrading to 19.1.0-beta.5 and Angular 18 HOT 1
- Issue when creating backend app in node for a NX monorepo HOT 1
- nx fails to create a workspace HOT 2
- NX_TASK_TARGET_PROJECT is not exposed in NX 19 HOT 2
- updateDependents feature is not working as expected. HOT 4
- Failed DTE tasks in Agents not replayed on the main job HOT 4
- Nx loading in multiple instances of packages and the shared function in webpack.config.js does nothing
- NX React 10kb inline limit customizable? HOT 1
- [Rollup] Update prettier version to 3
- v19.1.0 nx fails if bun.lockb is present HOT 3
- Angular - Compat matrix HOT 1
- Can't install after generating @nx/remix app due to conflicting peer dependency for vite
- Storybook run command terminates right after it successfully ran message HOT 3
- Can't open nx console generator ui since upgrade @nx/angular to 19.1 and angular 18 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nx.