Open ghost opened 6 years ago
I've spotted a couple of problems so far:
await
running in production app. It has to be done on with dev: isDev? await() : '';
index.html
file generated by next export
has references to /_next
which, on production app, will point to file:///_next
which obviously doesn't exist. All references must have the first /
removed from them._next
folder also needs to be under the start
folder.The first one is trivial to solve. The second and third have to be fixed manually everytime a new build is made. I'm not sure yet how to proceed next to make it automatic.
Just tried to build for production. everything seems to be working.
Hi !
I can confirm issues with your boilerblate
I am on windows 10 pro, with node 10 and npm 6
npm install
is running fine
Also npm start
works well, and hot reloading is marveillous when seen working inside an electron app !
But when running npm run dist
I got an error, because bundle
is not a valid command
E:\next_js\electron-next-skeleton>npm run dist
> electron-next-skeleton@1.0.0 dist E:\next_js\electron-next-skeleton
> npm run build && bundle
> electron-next-skeleton@1.0.0 build E:\next_js\electron-next-skeleton
> next build renderer && next export renderer
> Using "webpack" config function defined in next.config.js.
using build directory: E:\next_js\electron-next-skeleton\renderer\.next
exporting path: /start
"bundle" non è riconosciuto come comando interno o esterno,
un programma eseguibile o un file batch.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron-next-skeleton@1.0.0 dist: `npm run build && bundle`
npm ERR! Exit status 1
PS: please update the code, to use last version of all dependencies !
I did a clean clone of the repo, installed packages, then ran
npm run dist
. When I open the webpage I get an error:Not allowed to load local resource: .../ElectronNext.app/Contents/Resources/app.asar/renderer/out/start/index.html
To fix this, i disabled web security on the mainBrowser window:
The error is gone, but now the app loads a blank screen.
What might be the problem?