electron-pos-printer icon indicating copy to clipboard operation
electron-pos-printer copied to clipboard

webpack issue

Open kolucciy opened this issue 2 years ago • 1 comments

I'm using webpack template: yarn create electron-app my-new-app --template=webpack and I get the following error when printing: [ERROR]: (node:26596) electron: Failed to load URL: file:///C:/work/test/.webpack/main/renderer/index.html with error: ERR_FILE_NOT_FOUND

kolucciy avatar Jan 09 '23 12:01 kolucciy

I thought I solved the problem by copying the renderer folder from electron-pos-printer module and specifying the path using pathTemplate option, but the workaround only works when running in dev env.

Once application is built for production and executed as a standalone the following JS error is thrown inside "print preview" window:

Uncaught Error: Cannot find module 'qrcode'
Require stack:
- C:\work\test\out\kiosk-app-win32-x64\resources\renderer\index.html
    at Module._resolveFilename (node:internal/modules/cjs/loader:963:15)
    at o._resolveFilename (node:electron/js2c/renderer_init:2:3833)
    at Module._load (node:internal/modules/cjs/loader:811:27)
    at f._load (node:electron/js2c/asar_bundle:2:13328)
    at o._load (node:electron/js2c/renderer_init:2:3109)
    at Module.require (node:internal/modules/cjs/loader:1035:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at 121 (renderer.js:1:124)
    at n (renderer.js:1:240)
    at renderer.js:1:873

 Most likely that error is the root cause of https://github.com/Hubertformin/electron-pos-printer/issues/88

kolucciy avatar Jan 09 '23 13:01 kolucciy