TrilonIO / aspnetcore-Vue-starter

*NEW* Asp.net Core & Vue.js (ES6) SPA Starter kit - Vuex, webpack, Web API, Docker, and more! By @TrilonIO
https://www.trilon.io
MIT License
1.22k stars 266 forks source link

Latest version fails to switch to production #127

Open sksallaj82 opened 5 years ago

sksallaj82 commented 5 years ago

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.

MarkPieszak commented 5 years ago

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