saltyshiomix / nextron

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

Can't resolve 'babel-loader' #81

Closed AmazingTurtle closed 4 years ago

AmazingTurtle commented 4 years ago

Issue

next is building and serving, but electron does not open. Instead an error shows up in the console when runinng yarn dev

Commands

yarn global add nextron@latest
yarn create nextron-app some-project
cd some-project
yarn
yarn dev

Versions

npm -v
Now using node v10.20.1 (npm v6.14.4)
❯ npm -v
6.14.4
❯ node -v
v10.20.1
❯ yarn -v
1.22.4

Output

/usr/bin/node /usr/lib/node_modules/npm/bin/npm-cli.js run dev --scripts-prepend-node-path=auto

> my-nextron-app@1.0.0 dev /mnt/share/dev/some-project
> nextron

[ wait ]  starting the development server ...
[ info ]  waiting on http://localhost:8888 ...
[ ready ] compiled successfully - ready on http://localhost:8888
[ wait ]  compiling ...
[ ready ] compiled successfully - ready on http://localhost:8888
[
  "Entry module not found: Error: Can't resolve 'babel-loader' in '/mnt/share/dev/some-project'"
]

Process finished with exit code 0

Quick solution

I installed babel-loader via yarn add babel-loader and that seems to work fine. Suddenly the error disappears when running yarn dev again and electron opens. Seems like the dependency is missing.

frothywater commented 4 years ago

I encountered this problem as well. Webpack tries to resolve "babel-loader" in the cwd rather than in "node_modules/nextron" and therefore failed. Need repairing to Webpack configuration maybe?

saltyshiomix commented 4 years ago

Hi @AmazingTurtle , thank you for your reporting the issue!

I just published nextron@5.15.0which tries to fix this issue.

If you have some time, please try it and feel free to tell me advices :)

frothywater commented 4 years ago

Yeah, the problem is solved. Thanks! 😆