Hello there !
My project is based on yours.
In [main.js], my code is like this:
/**
__static path to static files in productionwhen I run dev, everything is OK.
But, when I run build and run the project, err occurred :
【A JavaScript error occurred in the main process】
【Uncaught Exception: ReferenceError: __stacic is not defined】
Any suggestion ?
THX
@silentpride did you find how to solve this issue? cheers
If anyone else comes across this issue, this is what solved it for me. Inside webpack.main.config.js and webpack.renderer.config.js I had to comment out the if statements that were checking if the process.env.NODE_ENV was not equal to 'production'.
@rodrigopavezi
yeah. check your process.env.NODE_ENV.
this works for me, thanks!!! Inside webpack.main.config.js and webpack.renderer.config.jscomment out process.env.NODE_ENV !== 'production'condition in lineif (process.env.NODE_ENV !== 'production') {
rendererConfig.plugins.push(
new webpack.DefinePlugin({
'__static':"${path.join(__dirname, '../static').replace(/\/g, '\\')}"
})
)
}
Most helpful comment
@rodrigopavezi
yeah. check your process.env.NODE_ENV.