Closed its-dibo closed 3 years ago
D:\Downloads\__projects\dev\NodeJs\@eng-dibo\ngx\dist\.node
is invalid path, please create reproducible test repo and use the issue template
D:\Downloads\__projects\dev\NodeJs\@eng-dibo\ngx\dist\.node
is invalid path, please create reproducible test repo and use the issue template
just typo, updated
Please create reproducible test repo, I can't help you without additional information
repo: https://github.com/eng-dibo/ngx
the base webpack config file is located in the workspace's root.
the issue occures when you build:server of the project 'cms' to do that, run the following command from the workspace's root.
npm run build:server:dev --prefix projects/cms
additional info: I installed sharp on windows 8 with this cmd:
npm i sharp
I will try the following, may this help
npm install --arch=x64 --platform=linux sharp
Why you use all is fine, my mistakenode-loader
for browser
target? It will not work, this loader only for node or electron
Anyway npm run build:server:dev --prefix projects/cms
doesn't have this error (linux/ubuntu)
I think sharp doesn't support windows@8
I think sharp doesn't support windows@8
it does, because I already used it before in the same laptop.
If you don't have .node
file, it means you really don't have it, there is no magic
We use very simple logic https://github.com/webpack-contrib/node-loader/blob/master/src/index.js#L32
I have .node file, but the problem is that it fails to be loaded by process.dlopen
you can see this file in dist/cms/core/server/[hash].node
We use very simple logic https://github.com/webpack-contrib/node-loader/blob/master/src/index.js#L32
yes, that exactly what I see in the output file. but as the title suggests it is seem that the issue is caused when executing this function.
This function from Node.js, we can't control execution here https://nodejs.org/api/process.html#process_process_dlopen_module_filename_flags
Run this function on this file (sharp.node
, inside dist), without webpack, just using simple Node.js script and look at result
No problems with loader as you can see
so, what are your suggestions?
Something wrong with sharp on windows 8, I can't even reproduce it on virtual machine, update windows...
Something wrong with sharp on windows 8, I can't even reproduce it on virtual machine, update windows...
thank you, @alexander-akait for your efforts <3
Can you try it on other machine under windows?
minimal reproduction: https://github.com/lovell/sharp/issues/2517#issuecomment-767703678
Why do you use externals: [nodeExternals()]
? It keep all modules from node_modules
inside or you fix the problem using externals
? Also do not forget to add node: { __dirname: false }
in config for webpack@4 (fixed in webpack@5)
I use
node-loader
to load.node
files with webpack, however, it generates the output files as expected indist
folder.and sharp.node exists in the same dir. but I got this error
the path determined in the error message is correct and exists
minimal reproduction: https://github.com/lovell/sharp/issues/2517#issuecomment-767703678