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
I agree to follow the code of conduct that this project uses.
I have searched the issue tracker for a bug that matches the one I want to file, without success.
Electron Forge version
6.0.0-beta.63
Electron version
19.0.1
Operating system
Windows 11 21H2
Last known working Electron Forge version
Unknown
Expected behavior
Strings with paths in them would not be replaced with undefined. That way, files could be read from the disk and used in the app.
Actual behavior
If a string does contain a path part that points to a file, the entire path aside from the filename is replaced with undefined. This is normally accomplished through things like __dirname, but the following example shows the behavior with an explicitly-defined string:
var path = 'C:\\Users\\example-user\\web\\example-project\\src\\some-path\\some-file.txt';
console.log(path);
// => "undefinedsome-file.txt"
I narrowed it down to the webpack-asset-relocator-loader plugin. Commenting out this plugin resolves the issue. However, I'm not sure the ramifications of this. Running the app locally and making a build seems to work...but maybe I'll run into issues later.
I have the same issue. I can't use sqlite3 in preload.ts due to this bug. The interesting thing — on first run (with yarn start) it works ok but only breaks on fast refresh. Upgrading webpack-asset-relocator-loader to 1.7.2 didn't fix an issue
Pre-flight checklist
Electron Forge version
6.0.0-beta.63
Electron version
19.0.1
Operating system
Windows 11 21H2
Last known working Electron Forge version
Unknown
Expected behavior
Strings with paths in them would not be replaced with undefined. That way, files could be read from the disk and used in the app.
Actual behavior
If a string does contain a path part that points to a file, the entire path aside from the filename is replaced with
undefined
. This is normally accomplished through things like__dirname
, but the following example shows the behavior with an explicitly-defined string:I narrowed it down to the
webpack-asset-relocator-loader
plugin. Commenting out this plugin resolves the issue. However, I'm not sure the ramifications of this. Running the app locally and making a build seems to work...but maybe I'll run into issues later.Steps to reproduce
Create an empty file at
./src/example/index.html
Add this snippet to
main.js
:appFilePath undefinedindex.html
.Additional information
No response
The text was updated successfully, but these errors were encountered: