You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[commonjs--resolver] node_modules/node-screenshots-darwin-x64/node-screenshots.darwin-x64.node (1:0): Unexpected character '�' (Note that you need plugins to import files that are not JavaScript)
#240
[commonjs--resolver] node_modules/node-screenshots-darwin-x64/node-screenshots.darwin-x64.node (1:0): Unexpected character '�' (Note that you need plugins to import files that are not JavaScript)
"electron": "^30.0.8"
The text was updated successfully, but these errors were encountered:
[commonjs--resolver] node_modules/node-screenshots-win32-x64-msvc/node-screenshots.win32-x64-msvc.node (1:2): Unexpected character '�' (Note that you need plugins to import files that are not JavaScript)
file: D:/code/electron/node_modules/electron-screenshots/lib/index.js:1:2
1: MZ������ �!�L�!This program cannot be run in DOS mode.
^
2: $���8���k���k���k���j���k���j��k���j���k5�j���k5�j���k5�j���k���j���k���kn��k���k���k�x�j���k�x�j���kRich�...
3: @� �� ��
?
I modified the code according to the method you provided, but this error still persists.
If you are using webpack to bundle the main process, modify the following configuration in the main process webpack configuration. Otherwise, issues may occur when invoking the screenshot window.
// vue.config.jsmodule.exports={publicPath: ".",pluginOptions: {electronBuilder: {// Do not bundle, use require to loadexternals: ["electron-screenshots"],},},};
Vite configuration example:
// vite.config.jsimport{defineConfig}from"vite";importviteExternalsfrom"vite-plugin-externals";exportdefaultdefineConfig({plugins: [viteExternals({"electron-screenshots": 'require("electron-screenshots")',// Module name: Global variable}),],});
[commonjs--resolver] node_modules/node-screenshots-darwin-x64/node-screenshots.darwin-x64.node (1:0): Unexpected character '�' (Note that you need plugins to import files that are not JavaScript)
"electron": "^30.0.8"
The text was updated successfully, but these errors were encountered: