-
-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to run the app on Windows with steamworks.js #3193
Comments
Not able to recreate this issue but one of my users is reporting the same. |
The reason for this error may be the .node file cannot find the .dll file in the same directory. I used esbuild to bundle dependencies. Initially, the build parameters were as follows: {
entryPoints: ["./src/main.ts"],
bundle: true,
platform: "node",
outfile: "./dist/main.js",
target: "es2017",
format: "cjs",
external: ["electron", "steamworks.js"],
sourcemap: true,
} These build parameters externalize steamworks.js, meaning it will not be bundled. Running not result in any errors. Then, I changed the parameters to: {
entryPoints: ["./src/main.ts"],
bundle: true,
platform: "node",
outfile: "./dist/main.js",
target: "es2017",
format: "cjs",
external: ["electron"],
sourcemap: true,
loader: {
".node": "copy",
}
} These parameters bundle steamworks.js and correctly copy the .node files. However, I encountered an error during runtime:
I realized that the error was due to the fact that these files were not copied. esbuild cannot bundle these files. The following files need to be manually copied to the dist directory:
In addition, if you manually add dll, you also need to set the
The content of my module.exports = {
packagerConfig: {
asar: false,
prune: false,
ignore: [/node_modules/],
},
rebuildConfig: {},
makers: [
{
name: "@electron-forge/maker-squirrel",
config: {},
},
{
name: "@electron-forge/maker-zip",
platforms: ["darwin"],
},
{
name: "@electron-forge/maker-deb",
config: {},
},
{
name: "@electron-forge/maker-rpm",
config: {},
},
],
plugins: [],
}; |
@LZQCN Thank you your solution worked. That solution only works for windows, in most other cases you should copy the entire dist directory |
Pre-flight checklist
Electron Forge version
6.0.5
Electron version
23.0.0
Operating system
Windows 11 Home, 22H2
Last known working Electron Forge version
No response
Expected behavior
The app opens.
Actual behavior
I get the following error when trying to run the app either from the exe generated by
make
or when started withstart
command.I verified all the files mentioned above, and they are present on the location they are expected.
Steps to reproduce
Simple electron app with steamworks.js ran on Windows 11 in Parallels Desktop should reproduce the issue. Not sure if it's important, but I use M2 Apple Silicon chip.
Additional information
Until we added steamworks.js, the app was working.
Not sure if it can be related, but I am running the project on M2 MacBook Pro, where I have Parallels Desktop and Windows 11 Home installed. So it is 64bit architecture running on ARM hardware. It is working for a colleague with Windows 11 machine just fine.
The text was updated successfully, but these errors were encountered: