Replies: 4 comments
-
Hi @SJFCS! I'm Dosu and I’m helping the wails team. The ENOENT errors happen because Wails expects static frontend files in a specific directory (like To run Wails v3 with Next.js in dev mode, you need to configure Wails to proxy requests to the Next.js dev server instead of looking for static files. You can do this by editing your {
"frontend:dev:watcher": "npm run dev --prefix frontend",
"frontend:dev:serverUrl": "http://localhost:3000"
} This setup tells Wails to start the Next.js dev server and proxy frontend requests to it. Make sure your Next.js app is running on the specified port ( You may also need to update your main HTML (or <meta name="wails-options" content="noautoinject" />
<script src="/wails/ipc.js"></script>
<script src="/wails/runtime.js"></script> Keep in mind that some Next.js features like SSR/ISR may not work seamlessly in this setup, since Wails is designed for SPAs and expects static assets in dev mode. For more details and working examples, check out community templates like wails-template-nextjs and wails-template-nextjs-app-router for reference configurations and scripts1234. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other Footnotes |
Beta Was this translation helpful? Give feedback.
-
This is not a Wails bug. Converting to discussion. |
Beta Was this translation helpful? Give feedback.
-
The ENOENT errors happen because Wails dev mode expects static files on disk, but Next.js serves assets dynamically from its own dev server and doesn't write all required files to disk in development. Copying files manually won't solve this because Next.js doesn't generate everything Wails expects. To fix this, configure Wails to proxy frontend requests to your running Next.js dev server. In your {
"frontend:dev:watcher": "npm run dev",
"frontend:dev:serverUrl": "http://localhost:3000"
} Replace the port if your Next.js dev server uses a different one. Next, update your <head>
<meta name="wails-options" content="noautoinject" />
<script src="/wails/ipc.js"></script>
<script src="/wails/runtime.js"></script>
</head> This ensures Wails injects its runtime scripts correctly when proxying to an external dev server source. Now, start your Next.js dev server ( Limitations: Go bindings may not work in the browser if you open the Next.js dev server directly, but they will work in the Wails desktop app. Make sure the dev server is running before starting Wails. This proxy setup is fully supported in the codebase, even though it’s not documented for Next.js specifically source. Community templates for Next.js + Wails exist, but they use similar workarounds. Let me know if you need help with the exact config or have trouble with the HTML changes! To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
When setting output: "standalone" in Next.js config, wails3 dev works fine but wails3 build fails. How can I automatically switch between these modes? import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// output: "export",
output: "standalone",
// Optional: Change links `/me` -> `/me/` and emit `/me.html` -> `/me/index.html`
trailingSlash: true,
// Optional: Prevent automatic `/me` -> `/me/`, instead preserve `href`
// skipTrailingSlashRedirect: true,
// Optional: Change the output directory `out` -> `dist`
distDir: "dist",
compress: false,
images: {
unoptimized: true,
},
};
export default nextConfig; |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
run
wails3 task build
is okbut run
wails3 dev
is error:To Reproduce
Expected behaviour
should start normally
Screenshots
Attempted Fixes
i try ,also not work
System Details
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions