Issue 1:
Preflight Checklist

I have read the Contributing Guidelines for this project.

I agree to follow the Code of Conduct that this project adheres to.

I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Electron Version

15.0.0

What operating system are you using?

Windows

Operating System Version

Windows 10 Professional

What arch are you using?

x64

Last Known Working Electron version

Not tested other electron vesions

Expected Behavior

I am expecting to not see warnings

Actual Behavior

I see these warnings:

DevTools failed to load source map: Could not parse content for file:///C:/work/MyProject/repo/dist/frontend/preload.js.map: Unexpected end of JSON input
DevTools failed to load source map: Could not parse content for file:///C:/work/MyProject/repo/dist/frontend/renderer.js.map: Unexpected end of JSON input
DevTools failed to load source map: Could not parse content for file:///C:/work/MyProject/repo/dist/frontend/rx-ipc.js.map: Unexpected end of JSON input
DevTools failed to load source map: Could not parse content for file:///C:/work/MyProject/repo/dist/frontend/Rx.js.map: Unexpected end of JSON input
DevTools failed to load source map: Could not parse content for file:///C:/work/MyProject/repo/dist/frontend/Subject.js.map: Unexpected end of JSON input
DevTools failed to load source map: Could not parse content for file:///C:/work/MyProject/repo/dist/frontend/Observable.js.map: Unexpected end of JSON input

Testcase Gist URL

No response

Additional Information

Hi,

in few words:

Under Linux (Debian Bookworm) works, under Windows, I have the warnings

I am using Parcel v2 to create the bundle

The issue seems quite clear: somehow under Windows it pretends to have the paths inside the "frontend" folder. Instead the files are inside the "backend" sister-folder, or inside the "node_modules/" folders. I have no idea of why this happens only under Windows... maybe some platform dependent code of electron

I have seen the related issues (#22996 seems the more relevant, but maybe also #28993, #24916, #24537), but I have open this one since it is similar, but not equal, and they are referring to much older versions of electron

Regards.

Issue 2:
Preflight Checklist

I have read the Contributing Guidelines for this project.

I agree to follow the Code of Conduct that this project adheres to.

I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Electron Version

^11.3.0

What operating system are you using?

macOS

Operating System Version

macOS Big Sur 11.2.3

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

location.reload() or electron reload shortcut to work in prod

sourcemap to load in prod

Actual Behavior

For production (mac dmg) builds of my electron app, I am unable to trigger location.reload(), connect to redux-dev-tools, and the sourcemap fails to load.

When the app is loaded, the console warns that it cannot load the sourcemap:

The index.html in the sources says the resource cannot be loaded:

Executing location.reload() causes the app to crash with a white screen and no console logs (this command works in electron dev builds).

My electron code is contained in electron/index.electron.js and the relevant snippets are:

const options = {
icon: join(__dirname, '../src/common/assets/app-icons/png/256x256.png'),
webPreferences: {
nodeIntegration: false,
preload: join(__dirname, "preload.js")
}
};
// ...
mainWindow = new BrowserWindow({
...options,
...windowOptions
});
// ...
const startUrl = process.env.ELECTRON_START_URL || url.format({
pathname: "file://../build/index.html"
});
// ...
mainWindow.loadURL(startUrl);

The relevant package.json snippets:

"homepage": "./",
"scripts": {
"electron-build:mac": "rm -rf dist/ && yarn build && electron-builder -m",
},
"build": {
"appId": "appId",
"extends": null,
"files": [
"dist/**/*",
"build/**/*",
"node_modules/**/*",
"src/common/assets/**/*",
"public/*",
"electron/**/*"
],
"directories": {
"buildResources": "./src/common/assets"
}
},
"devDependencies": {
"electron": "^11.3.0",
"electron-builder": "^22.9.1"

The only thing I can confirm in dev is that running location.reload() successfully reloads the app.

Thanks :)

Testcase Gist URL

No response

Additional Information

The same problems exist for linux and windows builds