vue app not working after npm run build for production - vue.js

So I created a simple app with vue and works as I expected. But since I ran npm run build and I tried to run that project from /dist directory(for produnction) I just stops. What am i missing here guys?

Related

ng-zorro Error: Module not found when trying to run project

I'm using ng-zorro v14.1.1 for my angular 14.2.7. But when I try to run my angular application, I got errors when building the project looking for modules from ng-zorro and identifying it as not found even though the files existed in the project.
Here's the full view of the error:
Additional detail of the project:
Angular Electron project
Angular 14.2.7
Electron 21.2.0
Thanks in advance for helping!
I tried removing node-modules and re-install ng-zorro-antd using ng add ng-zorro-antd, and even npm install ng-zorro-antd if it makes a difference but to no avail, I'm still having the issue. Thus, can't run the project.
I have solved my problem. What I did was to install the modules that are mentioned in the error:
I ran the commands:
npm i d3-zoom --> this command gives you hint on what to do next when you're trying to run the project after the installation is finished, and it instructed me to run the next command below:
npm i --save-dev #types/d3-zoom
npm i dagre-compound
npm i d3-shape

Cannot find module 'postcss-preset-env' error using create-react-app inside an npm workspace

I'm trying to add a create-react-app app inside a Turborepo monorepo.
Problem is that if I run npm install from the root of the monorepo and then try to start the CRA app by running npm run dev, I get the following error during compile time:
Loading PostCSS "postcss-preset-env" plugin failed: Cannot find module 'postcss-preset-env'
I noticed that if I run npm install from within the CRA app folder (/apps/my-app), and then run npm run dev from the root of the monorepo, it runs just fine.
I also noted that depending from where I run npm install, the contents of /apps/my-app/node_modules will be different, but I think is the expected behaviour.
If I understand correctly the npm workspaces docs, you should always run npm install from the root of the monorepo.
Any idea on what I'm missing here?
I'm using npm 8.3.1.
Here is a public repo with an example: https://github.com/oncet/turborepo-cra

My changes made in Dashboard.vue aren't being saved (Laravel Jetstream Inertia.js)

This is my first day working with this so I'm not sure what's going on.
When I start up my laravel project and add jetstream(inertia.js) and make changes to my resources/js/Dashboard.vue file, I open my local server and go to /dashboard and those changes don't appear on the website.
Things I've tried:
Made sure it wasn't my development server because I was able to change welcome.blade.php
Ran npm run dev again.
Steps I made when I create the app:
1. ran laravel new ProjectName --jet
2. opened my project in VSCODE
3. ran npm install && npm run dev
4. Made changes to my Welcome.blade.php
5. Attempt at changing Dashboard.vue
When you start your application, just type the following in your terminal.
1. npm install
2. npm run dev
3. npm run prod
4. npm run watch
5. php artisan serve
And it should all work, for the question i had, all i used was steps. 1,2,4,5. But i ran into a problem later regarding something else and then ran npm run prod and it fixed.

Run a Vue.js project in server without " npm run dev " command?

After installing vue cli globally by running npm install -g vue-cli, I have installed all the modules in the project folder "myBlog" by running npm install and can run the project in my local environment by using npm run dev. But when I am going to move this project in the live server is this is the right way to run the batch program (npm run dev) continuously or there are other ways to run the project without running npm run dev continuously?
It's not Vue specific but you also should be able to run npm run build which generates production bundles in /dist subfolder of your project. You are supposed to copy this folder to the production server and configure the server so that it serves dist/index.html for every URL.
If you are using the "webpack", "webpack-simple" or "pwa" template there is a dedicated command for creating the production build, which allows a static hosting (with no need to run any npm process in the server):
npm run build
It will create a dist folder which content you can upload to the root of your server.
Some more info about:
"webpack" template:
https://vuejs-templates.github.io/webpack/commands.html#npm-run-build
"webpack-simple":
https://github.com/vuejs-templates/webpack-simple#webpack-simple
"pwa": https://github.com/vuejs-templates/pwa#whats-included
Very simple. To launch a VueJs project, you must type "npm run serve".

webpack-simple routing not working in production mode

I am using webpack-simple template for development with vue-js 2. I am using routing throug vue-router. It works fine in the development mode
npm run dev
After building, I got build.js in the dist folder using the below command
npm run build
With index.html and dist folder, I try to run the project but fail. No error found in the console also