saltyshiomix / nextron

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

Nextron 6.0.1 webpack configuration broken #136

Closed dac09 closed 3 years ago

dac09 commented 3 years ago

Hi, I just tried updating to the latest nextron. Relevant dependencies

    "next": "^10.0.3",
    "nextron": "^6.0.1",

It seems to fail launching with a Babel error.

App threw an error during load
Error: Module parse failed: Unexpected token (51:12)

My project is based on with-typescript-emotion

saltyshiomix commented 3 years ago

Hi @dac09 !

My project is based on with-typescript-emotion

So you mean, did you upgrade nextron from v5 to v6?

dac09 commented 3 years ago

Yes, that's right. Previously:

    "next": "9.5.1",
    "nextron": "^5.15.3",
saltyshiomix commented 3 years ago

Sorry I didn't write upgrade guides.

saltyshiomix commented 3 years ago

Do you have .babelrc ?

saltyshiomix commented 3 years ago

As of nextron@6, we need to set presets to use custom .babelrc for main process:

{
  "presets": [
    "nextron/babel"
  ]
}
dac09 commented 3 years ago

Unfortunately that still doesn't work

Updated .babelrc with the following

{
  "presets": ["nextron/babel", "next/babel", "@emotion/babel-preset-css-prop"],
  "plugins": ["emotion", "babel-plugin-macros"]
}
dac09 commented 3 years ago

Sorry, I updated the wrong babel rc in renderer/.babelrc. However adding .babelrc in the root of the project doesn't seem to work either.

saltyshiomix commented 3 years ago

No problem, thank you for your reporting the issue!

I'll investigate it, please wait a moment.

saltyshiomix commented 3 years ago

@dac09

Do you have ./.babelrc?

I didn't encounter the problem...

dac09 commented 3 years ago

Yes I tried with it too, same issue

saltyshiomix commented 3 years ago

@dac09

Could you tell me the code L51:12?

Error: Module parse failed: Unexpected token (51:12)
dac09 commented 3 years ago

Nothing special @saltyshiomix, just some import statements. I don't have the exactly log now, but it definitely works on nextron 5.x

jarthursantos commented 3 years ago

I'm having the same problem, i just create a .babelrc with "presets": ["nextron/babel", "next/babel"] and this don't work, in 5.x a log pops up in console informing external babel config, but now that don't occours

dac09 commented 3 years ago

Closing this, as it seems to have been resolved in 6.0.6. I was able to upgrade and build without too much hassle!