saltyshiomix / nextron

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

global is not defined #312

Closed HA-SEUNG-JEONG closed 1 year ago

HA-SEUNG-JEONG commented 1 year ago

image

and I run yarn && yarn dev,

image

localhos:8888 not showing...

image

HoudhaifaNA commented 1 year ago

I think because global doesn't work on the browser, so don't open the project in the browser run yarn dev and it will open a desktop app.

HA-SEUNG-JEONG commented 1 year ago

No need to modify the code? Running with yarn dev doesn't open it either.

When I run it with yarn dev, I get this:

and I'm using WSL2.

image

HoudhaifaNA commented 1 year ago

Try to delete the project and create it again and try npm instead of yarn because I installed the project yesterday and it worked fine. But don't update electron because it will break

saltyshiomix commented 1 year ago

@HA-SEUNG-JEONG

Could you tell me the version of electron?

HA-SEUNG-JEONG commented 1 year ago

@saltyshiomix The version is 8.4.

saltyshiomix commented 1 year ago

@HA-SEUNG-JEONG

Sorry, not nextron version, but electron version, please?

Because the issue below may have something to do with this error.

https://github.com/saltyshiomix/nextron/issues/299

manuthecoder commented 1 year ago

I am experiencing the same issue - and I followed all the directions on the README file.

Ahtisham-01 commented 1 year ago

modify the next.config.js:

if (!isServer) {
  config.target = 'electron-renderer';
  config.node = {
    __dirname: true,
  };
}

config.output.globalObject = 'this';
alexis-piquet commented 1 year ago

@HA-SEUNG-JEONG, Could you give me more context of your usage? I don't understand why you want to use global.