New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples on deployment on Azure? #906
Comments
Hi, This is most probably related to #356 (environmental variables such as We use this workaround in module.exports = {
...
modify: (config, { target, dev }, webpack) => {
const appConfig = Object.assign({}, config);
// @BUG: Do not inline certain env vars; https://github.com/jaredpalmer/razzle/issues/356
if (target === 'node') {
const idx = appConfig.plugins.findIndex(plugin => plugin.constructor.name === 'DefinePlugin');
const { definitions } = appConfig.plugins[idx];
const newDefs = Object.assign({}, definitions);
delete newDefs['process.env.PORT'];
delete newDefs['process.env.HOST'];
delete newDefs['process.env.PUBLIC_PATH'];
appConfig.plugins = [].concat(appConfig.plugins);
appConfig.plugins[idx] = new webpack.DefinePlugin(newDefs)
}
return appConfig;
},
}; |
I tried this config but when I try command 'npm run start:prod' on my local, I get an error that assets.json not found. could you please advise in this? |
@vbutani |
Thanks @fabianishere for the quick response. My bad, while doing code change suggested, I found my custom code issue in modify method. Thanks a lot. :) |
I'm trying to deploy a razzle app to an Azure App Service but I'm having trouble running the server. I built the app and got a build folder. Then, I used this web.config file and changed the entry points to build/server.js. The app seems to run ok, because I checked the logs and the classic
appears. When I go to the url of the app, there's no response whatsoever. Just an error 500 when the request times out.
I checked the build on my local machine running
node build/server.js
and everything works as expected.
Hope you can help.
Regards.
The text was updated successfully, but these errors were encountered: