Package breaks Azure web app deployment
Could not deploy my custom webapp to azure ... after deployment, get message in browser: An error occurred while starting the application. .NET Core 4.6.27317.03 X86 v4.0.0.0 | Microsoft.AspNetCore.Hosting version 2.1.1-rtm-30846 | Microsoft Windows 10.0.14393 (when the app launches in Browser)
removing app.UseNodeModules(env); from Configure method is a fix.
Is there another fix / app workaround that will allow us to continue to use the package or does the code need to be modified.
The most common reason for a startup error to happen with this package is not having a node_modules folder present after you deploy. Check if the app service has a node_modules folder, if not you'll have to run npm install on the app service, or during deployment, or publish the node_modules files (they are excluded by default).
If you have a node_modules folder in the app service and the error is still occurring, could you try the tips listed here to track down the actual exception message? https://odetocode.com/blogs/scott/archive/2018/07/16/7-tips-for-troubleshooting-asp-net-core-startup-errors.aspx
The most common reason for a startup error to happen with this package is not having a node_modules folder present after you deploy. Check if the app service has a node_modules folder, if not you'll have to run npm install on the app service, or during deployment, or publish the node_modules files (they are excluded by default).
If you have a node_modules folder in the app service and the error is still occurring, could you try the tips listed here to track down the actual exception message? https://odetocode.com/blogs/scott/archive/2018/07/16/7-tips-for-troubleshooting-asp-net-core-startup-errors.aspx Hi Ode, question is if we include those node_modules, are we include the folder as it is or have to manually move it to wwwroot folder? kind regards, Jian
Include the folder as is - if the files were under wwwroot you wouldn't need this package and could use the built-in static files middleware.