Closed TRUEJASONFANS closed 3 years ago
I have experienced this too, right after upgrading to v7 of Nextron (Next v11.x).
Here is the full log I got out of building the project:
I would provide a repro demo, but the build process is broken even in the examples, so far I have tried both the Javascript and Typescript Tailwind demos, they both show up the same (apart from some TS build steps) errors.
/cc @saltyshiomix sorry for the ping, but I'd love your comment on this.
@filiptronicek I have this issue even in v7 of Nextron. The following is my package.json
{
"private": true,
"name": "my-nextron-app",
"description": "My application description",
"version": "1.0.0",
"author": "Yoshihide Shiono <shiono.yoshihide@gmail.com>",
"main": "app/background.js",
"scripts": {
"dev": "nextron",
"build": "nextron build",
"postinstall": "electron-builder install-app-deps"
},
"dependencies": {
"electron-serve": "^1.1.0",
"electron-store": "^8.0.0"
},
"devDependencies": {
"@types/node": "^14.14.31",
"@types/react": "^17.0.0",
"autoprefixer": "^10.3.1",
"electron": "^13.1.7",
"electron-builder": "^22.11.7",
"next": "^11.0.1",
"nextron": "^7.0.0",
"postcss": "^8.3.6",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"tailwindcss": "^2.2.7",
"typescript": "^4.3.5"
}
}
@TRUEJASONFANS I don't know if this is the right solution.
next.config.js
module.exports = {
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer';
config.node = {
__dirname: true,
}
}
return config;
},
};
@TRUEJASONFANS I don't know if this is the right solution.
next.config.js
module.exports = { webpack: (config, { isServer }) => { if (!isServer) { config.target = 'electron-renderer'; config.node = { __dirname: true, } } return config; }, };
This worked for me!
sadly, @larskarbo @juicyjusung I still get same error after use @larskarbo 's change.
@TRUEJASONFANS Make sure you add config.node = { __dirname: true, }
to next.config.js
inside the renderer
folder and not the root folder.
I can reproduce this problem, and I think #199 is the solution.
node:16.4.0 using the template with-typescript-tailwindcss
after use 'yarn build'