electron-webpack icon indicating copy to clipboard operation
electron-webpack copied to clipboard

Error with dll: Error: Can't resolve './vendor.js' in dist

Open maximilize opened this issue 5 years ago • 3 comments

  • Version: 2.8.2

After compiling dll and trying to start the dev server, this error happens:

ERROR in ./dist/.renderer-index-template.html (./node_modules/html-loader/dist/cjs.js?minimize=false!./dist/.renderer-index-template.html)
Module not found: Error: Can't resolve './vendor.js' in '/foo/bar/dist'
@ ./dist/.renderer-index-template.html (./node_modules/html-loader/dist/cjs.js?minimize=false!./dist/.renderer-index-template.html) 3:33-55

This issue happens because the vendor.js is writting into dist/renderer-dll/vendor.js, but inside /dist/.renderer-index-template.html it is imported without any path.

Issue #155 and pull request #173 addressed this issue already some years ago, but in the meantime html-loader seem to removed the url parameter which fixed this issue back then.

maximilize avatar Aug 12 '20 12:08 maximilize

When changing RendererTarget.js from

scripts.push(`<script type="text/javascript" src="${asset}"></script>`);
// to
scripts.push(`<script type="text/javascript" src="renderer-dll/${asset}"></script>`);

the compilation works, but then it looks like that HtmlWebpackCompiler or some other module is changing the src="..." to src="[object Object"] which is obviously an error.

For me the whole dll functionality is broken.

maximilize avatar Aug 12 '20 13:08 maximilize

Bumping this issue as I'm having the same problem -- For some reason the vendor.js file in renderer-dll directory is not being given the correct path by the renderer-index-template.html

CorradoRossi avatar Oct 05 '20 13:10 CorradoRossi

Same issue for me

super-ienien avatar Dec 10 '20 13:12 super-ienien