Open mikeallisonJS opened 5 months ago
new error with Nx 19.4.0
NX Unable to create bun lock files. Run bun install it's just as quick
node:internal/process/promises:391
triggerUncaughtException(err, true /* fromPromise */);
^
HookWebpackError: argument 'value' must be either string of Buffer
at makeWebpackError (/workspaces/core/node_modules/webpack/lib/HookWebpackError.js:48:9)
at /workspaces/core/node_modules/webpack/lib/Compilation.js:3181:12
at eval (eval at create (/workspaces/core/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:13:1)
at fn (/workspaces/core/node_modules/webpack/lib/Compilation.js:488:17)
at _next0 (eval at create (/workspaces/core/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:11:1)
at eval (eval at create (/workspaces/core/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:24:1)
at Hook.eval [as callAsync] (eval at create (/workspaces/core/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/workspaces/core/node_modules/tapable/lib/Hook.js:18:14)
at /workspaces/core/node_modules/webpack/lib/Compilation.js:523:46
at /workspaces/core/node_modules/@nx/webpack/node_modules/copy-webpack-plugin/dist/index.js:909:9
-- inner error --
TypeError: argument 'value' must be either string of Buffer
at new RawSource (/workspaces/core/node_modules/webpack-sources/lib/RawSource.js:16:10)
at /workspaces/core/node_modules/@nx/webpack/src/plugins/generate-package-json-plugin.js:39:82
at fn (/workspaces/core/node_modules/webpack/lib/Compilation.js:486:10)
at _next0 (eval at create (/workspaces/core/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:11:1)
at eval (eval at create (/workspaces/core/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:24:1)
at Hook.eval [as callAsync] (eval at create (/workspaces/core/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/workspaces/core/node_modules/tapable/lib/Hook.js:18:14)
at /workspaces/core/node_modules/webpack/lib/Compilation.js:523:46
at /workspaces/core/node_modules/@nx/webpack/node_modules/copy-webpack-plugin/dist/index.js:909:9 {
details: 'caused by plugins in Compilation.hooks.processAssets\n' +
"TypeError: argument 'value' must be either string of Buffer\n" +
' at new RawSource (/workspaces/core/node_modules/webpack-sources/lib/RawSource.js:16:10)\n' +
' at /workspaces/core/node_modules/@nx/webpack/src/plugins/generate-package-json-plugin.js:39:82\n' +
' at fn (/workspaces/core/node_modules/webpack/lib/Compilation.js:486:10)\n' +
' at _next0 (eval at create (/workspaces/core/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:11:1)\n' +
' at eval (eval at create (/workspaces/core/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:24:1)\n' +
' at Hook.eval [as callAsync] (eval at create (/workspaces/core/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)\n' +
' at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/workspaces/core/node_modules/tapable/lib/Hook.js:18:14)\n' +
' at /workspaces/core/node_modules/webpack/lib/Compilation.js:523:46\n' +
' at /workspaces/core/node_modules/@nx/webpack/node_modules/copy-webpack-plugin/dist/index.js:909:9',
module: undefined,
loc: undefined,
hideStack: true,
chunk: undefined,
file: undefined,
hook: 'Compilation.hooks.processAssets',
error: TypeError: argument 'value' must be either string of Buffer
at new RawSource (/workspaces/core/node_modules/webpack-sources/lib/RawSource.js:16:10)
at /workspaces/core/node_modules/@nx/webpack/src/plugins/generate-package-json-plugin.js:39:82
at fn (/workspaces/core/node_modules/webpack/lib/Compilation.js:486:10)
at _next0 (eval at create (/workspaces/core/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:11:1)
at eval (eval at create (/workspaces/core/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:24:1)
at Hook.eval [as callAsync] (eval at create (/workspaces/core/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/workspaces/core/node_modules/tapable/lib/Hook.js:18:14)
at /workspaces/core/node_modules/webpack/lib/Compilation.js:523:46
at /workspaces/core/node_modules/@nx/webpack/node_modules/copy-webpack-plugin/dist/index.js:909:9
}
Node.js v20.15.0```
setting generatePackageJson: false,
in webpack config can skip this error, but most likely not a fix
setting
generatePackageJson: false,
in webpack config can skip this error, but most likely not a fix
No, we need individual webpacks generated otherwise our images are extremely bloated.
@mikeallisonJS not a fix
same error in MacOS using node 20, bun as pm and @nx/nest
same error in Windows using node 20.17.0, bun as pm and @nx/nest
Currently bun doesn't support generating lock files which is what generate package json requires. Youl could create a patch that will run bun install in the background
Same issue.
@jaysoo Should be able to generate lock files soon as a text file bun.lock
Should solve quiet a few issues
source: https://x.com/jarredsumner/status/1839056611765268651
any update ?
@guysenpai Bun not added support for generating lock files yet. Once their added https://github.com/nrwl/nx/pull/28119 should be ok
Faced same issue. I had to switch from bun to npm to make it work.
Current Behavior
When attempting to use bun as package manager, our nestjs and graphql-yoga apps fail to build in @nx/webpack. This seems like the final issue stopping us from migrating to bun as a package manager
Without generatePackageJson it seems to build correctly.
Expected Behavior
Should build to dist with package.json and bun.lockb
GitHub Repo
https://github.com/JesusFilm/core/tree/24-03-MA-feat-bun-package-manager
Steps to Reproduce
Nx Report
Failure Logs
Package Manager Version
bun 1.1.16
Operating System
Additional Information
Have tried with bun since 1.1.11 and since initial nx bun release