Closed rnza0u closed 3 years ago
Currently, I support only workspace/angular.json at the workspace root. I do no know if nx supports splitting the configuration into separate project.json file (if so, kindly provide the docs for it). Nevertheless, I do not plan to change this behavior soon, but you are more then welcome to provide a PR.
Here is the documentation about this type of configuration.
https://nx.dev/l/n/core-concepts/configuration#projectjson
It is very useful when having a lots of projects within an nx.js workspace. Otherwise you end up with a 100000 lines workspace.json file.
I might add a PR about this.
I might fixed it when I had upgraded the plugin to version 12. I now do not rely on angular devkit anymore. Would you mind test if that works for you on v12?
Oh yes, this is probably why.
I was looking at the stack trace provided in my first post and the "workspace" object is from the angular devkit.
Angular devkit surely does not support separate project files, only workspace/angular.json.
I will try v12 soon and will let you know if it works or not. 👍
What is the update procedure for version 12 ?
The update guide says to use "ng", but since you don't use angular devkit anymore, is it still the right way ?
You can use nx/ng to update. The plugin should support both devkits.
I created at test project with nx.js@12.10.0
and nx-electron@12.0.0-alpha.5
.
I generated a test electron app successfully and i put the project object into a separate project.json
file.
I think the problem is gone. However i get another error while building, which is not related to the project.json
issue.
Here is the stack trace:
> nx run electron-app:build
E:\dev\test-nx\test\node_modules\nx-electron\node_modules\loader-runner\lib\LoaderRunner.js:133
if(isError) throw e;
^
Error: Digest method not supported
at new Hash (internal/crypto/hash.js:46:19)
at Object.createHash (crypto.js:116:10)
at module.exports (E:\dev\test-nx\test\node_modules\nx-electron\node_modules\webpack\lib\util\createHash.js:136:53)
at NormalModule._initBuildHash (E:\dev\test-nx\test\node_modules\nx-electron\node_modules\webpack\lib\NormalModule.js:417:16)
at E:\dev\test-nx\test\node_modules\nx-electron\node_modules\webpack\lib\NormalModule.js:452:10
at E:\dev\test-nx\test\node_modules\nx-electron\node_modules\webpack\lib\NormalModule.js:323:13
at E:\dev\test-nx\test\node_modules\nx-electron\node_modules\loader-runner\lib\LoaderRunner.js:367:11
at E:\dev\test-nx\test\node_modules\nx-electron\node_modules\loader-runner\lib\LoaderRunner.js:233:18
at context.callback (E:\dev\test-nx\test\node_modules\nx-electron\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
at Object.loader (E:\dev\test-nx\test\node_modules\nx-electron\node_modules\ts-loader\dist\index.js:18:9)
at LOADER_EXECUTION (E:\dev\test-nx\test\node_modules\nx-electron\node_modules\loader-runner\lib\LoaderRunner.js:119:14)
at runSyncOrAsync (E:\dev\test-nx\test\node_modules\nx-electron\node_modules\loader-runner\lib\LoaderRunner.js:120:4)
at iterateNormalLoaders (E:\dev\test-nx\test\node_modules\nx-electron\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
at Array.<anonymous> (E:\dev\test-nx\test\node_modules\nx-electron\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
at Storage.finished (E:\dev\test-nx\test\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
at E:\dev\test-nx\test\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
———————————————————————————————————————————————
> NX ERROR Running target "electron-app:build" failed
Failed tasks:
- electron-app:build
Hint: run the command with --verbose for more details
It seems like webpack is trying to use the native Node createHash
function with this algorithm: xxhash64
I don't think that this is supported natively by Node. Maybe i need to upgrade my Node version ? I'm using 14.17.4
.
Any idea ?
This is due to the reason I tried to stick with webpack 4, but I decided to upgrade it to webpack 5 (which will solve this issue). Also, I think project.json was introduces in nx v13, so it would be supported by nx-electron@13.
Description Build fails when describing project in a separate project.json file at the project's root folder, instead of the main workspace/angular.json at the workspace root.
Error is:
To reproduce Steps to reproduce the behavior:
Expected behavior Project should build.
Context