menu

Questions & Answers

Where is app.js file? What does it mean? in vue

enter image description hereenter image description here enter image description hereenter image description here enter image description here

Hello, there is no app.js file in my website, but I keep getting this error and it affects the site. Normally, Google Lighthouse gives information about the problem, but this time Google Lighthouse didn't give the any information. What do you recommend?

Thank you

Comments:
2023-01-23 23:20:04
Please include code as text in a code block, not as images. Why should I not upload images of code/data/errors?
Answers(2) :

app.js is the "bundle". It is a concatenation of all your application's files into one.

Try running:

npm run build

and inspect the files generated at the /dist folder.

The files in the /dist folders are basically the output webpack produces when it builds your project. app.js itself, as said, is a concatenation of all your application's files (those written by yourself and maybe some third-party that you imported), after some transformations performed by plugins and webpack itself.

Comments:
2023-01-23 23:20:04
i don't have app.js file. How can i create it?
2023-01-23 23:20:04
Run npm run build, app.js will be automatically generated by vue.
2023-01-23 23:20:04
i did but it didn't work. If you want, i can send a photo about it
2023-01-23 23:20:04
Run num run build, and paste your package.json in the question. You can paste a picture of the folder structure too
2023-01-23 23:20:04
i added pictures
2023-01-23 23:20:04
Show your folder structure after you run npm run build
const mysql = require ('mysql');
const connection = mysql.createConnection ({
  hôte: «localhost»,
  utilisateur:'utilisateur',
  mot de passe:'mot de passe',
  base de données:'nom de la base de données'
});
connection.connect ((err) => {
  if (err) throw err;
  console.log ('Connecté!');
});