aspnetcore-Vue-starter icon indicating copy to clipboard operation
aspnetcore-Vue-starter copied to clipboard

Latest version fails to switch to production

Open sksallaj82 opened this issue 5 years ago • 1 comments

I been using previous versions to this update and switching to production has no problem. However, with the latest build I had last night, I ran into issues where I can't switch to production no matter what I do. It runs all the prod scripts, hides modules, etc. But when I run it, it says:

vue.js:9057   You are running Vue in development mode.
              Make sure to turn on production mode when deploying for production.
              See more tips at https://vuejs.org/guide/deployment.html
client.js:92  [HMR] connected

In the google console.

And when I deploy to IIS, it gives me a server side error:

One or more errors occurred. (Webpack dev middleware failed because of an error while loading 'aspnet-webpack'. Error was: Error: Cannot find module 'aspnet-webpack'

I'm not sure why it still thinks I'm on dev no matter what I do.

I even created this bat file:

call xcopy /Y "%~dp0appsettings.Production.json" "%~dp0appsettings.json"
call rmdir /S /Q "%~dp0wwwroot"
call setx ASPNETCORE_ENVIRONMENT "Production" /M
call npm run build
:End
PAUSE

And it ran well. All the scripts executed successfully, but I still get the same errors. If I run other projects that I had based on this repo, I didn't run into these issues.

sksallaj82 avatar Apr 19 '19 16:04 sksallaj82

How are you running your publish script?

Maybe there's something in here that could help make sure it's using the correct json file?

https://github.com/aspnet/AspNetCore/issues/5169

That's strange that Prod builds aren't running correctly in the master branch - nothing for that was changed hmmm

MarkPieszak avatar Apr 19 '19 18:04 MarkPieszak