saltyshiomix / nextron

⚡ Next.js + Electron ⚡
https://npm.im/nextron
MIT License
3.97k stars 229 forks source link

setup with next 14 #439

Open paras258 opened 9 months ago

paras258 commented 9 months ago

Does anyone have idea how to setup nextron with next 14?

MemerGamer commented 7 months ago

I somehow managed to set up the base project with the latest electron and NextJS on node v20.12.2

(Currently trying to resolve the build process, development build is succesfull, but production build fails)

The steps i followed: Note: I run npm install frequently to check if the electron builder fails

Here I tested if the app works with dev build by running

npm run dev

I needed to update some outdated code parts that were modified from Next v12 to v14 like including <a> tags in <Link> has become legacy stuff, so i removed the unnecessary anchor tags

I hope this helps, currently I am trying to resolve some build problems, since next export command was removed in favor of output: "export"

MemerGamer commented 7 months ago

Update on this, even though i tried creating custom NextJS configuration the build step is too tied to nextron which makes things complicated even when trying to build the app via the native electron builder.

So the current best thing we can do is to use the NextJS v13 until nextron support officially v14.

gkorland commented 6 months ago

@MemerGamer thanks for the update! @saltyshiomix any plans to support Next 14 in the near future?

saltyshiomix commented 6 months ago

@gkorland

Thank you for mention me :)

We hope to have Next.js v14 support by the end of May 🙇

gkorland commented 6 months ago

Would love to help/test it when you have something working

saltyshiomix commented 6 months ago

@gkorland

Thank you very much! I will be sure to contact you when I release it :)

saltyshiomix commented 5 months ago

@paras258 @MemerGamer @gkorland

Sorry for late reply and inconvenience.

I just released nextron v9.0.0, which supports next.js v13 and v14. If you have time, please try it :)


NOTE:

Please update renderer/next.config.js as belows:

module.exports = {
  output: 'export',
  // we want to change distDir to "app" so as nextron can build the app in production mode!
  distDir: process.env.NODE_ENV === 'production' ? '../app' : '.next',
  trailingSlash: true,
  images: {
    unoptimized: true,
  },
}
MemerGamer commented 5 months ago

@saltyshiomix just updated my project to the latest Next.js (v14.2.4) and the latest nextron (9.1.0) version using Node v20.15.0 and it works great!

saltyshiomix commented 5 months ago

@saltyshiomix just updated my project to the latest Next.js (v14.2.4) and the latest nextron (9.1.0) version using Node v20.15.0 and it works great!

Thank you for trying it! If you have any troubles, feel free to contact me :)

makhdum530 commented 1 month ago

Error: Page "/demo/service/[id]" is missing "generateStaticParams()" so it cannot be used with "output: export" config. in next js 14 app

makhdum530 commented 1 month ago

@saltyshiomix just updated my project to the latest Next.js (v14.2.4) and the latest nextron (9.1.0) version using Node v20.15.0 and it works great!

Error: Page "" is missing "generateStaticParams()" so it cannot be used with "output: export" config. have you get any error like this when run build