Closed HoudhaifaNA closed 1 year ago
The app
directory is reserved in Next.js 13, but nextron's build uses it. Will have to downgrade to Next.js 12 or parameterize the app
directory and read it from the config... I want to make a PR but don't have time right now.
Actually, it works. I am in development and it works, I hope it will be the same in production.
For production build, we need to run next export
command for production static files, but currently Next.js does not support next export
with app
directory.
See here for more information:
https://beta.nextjs.org/docs/app-directory-roadmap#planned-features
Issues:
@saltyshiomix is there a possibility to hardcode the exportMapPath
in next.config.js order to fix this?
@saltyshiomix @HoudhaifaNA FYI, with the release of the stable next export command with the app directory, I was able to get both dev and prod to work without changing the nextron configuration.
I'm new to the project, so I'm not sure how "hacky" this is, but I got it to work. Please feel free to let others know if this is or is not a preferred approach.
https://nextjs.org/docs/app/building-your-application/deploying/static-exports
I only changed my next.config.js to export to the root app directory and things seem to work. The app directory for my nextjs application followed one of the examples and is in the renderer folder, so no conflict.
Dev working: https://github.com/iancleary/horizon/issues/10#issuecomment-1546756741
Prod working: https://github.com/iancleary/horizon/issues/10#issuecomment-1546757114
PR showing my CI builds: https://github.com/iancleary/horizon/pull/12
A note on the app/
in the root of the project.
The only thing to note is that the dev and build temporary files share the root app/ folder. If you care to preserve both, that might be an issue for you. I am fine with that as they are both folders that are removed/cleaned in the start of dev mode or the start of a build...so no stale files cross contaminate across dev to prod or from prod to dev.
How can I make use of this in nextron? When installed, nextron brings Next 12, not 13. Shall I manually upgrade to 13 in package.json? My app is developed using App router - I just need to make it work on Electron...
@iancleary Seems to work fine until I import "electron" into any files.. Getting this error:
Electron failed to install correctly, please delete node_modules/electron and try installing again at getElectronPath
Is there a way to use the standalone
approach instead of output: export
, where electron
actually spins up the next server itself and runs it locally?
Can we use app dir feature in next v13 ? When I use it everytime I click on a link it reloads the page. Also when I upgrade to latest Electron version v22.0.3, it doesn't work