0

parcel did not inject js and css code to the resulted html

I'M new parcel and tried opening the website using parcel it shows but without css or js...Path is correct and styling works fine when using live server vs code package.json : { "name": "edity", "version": "1.0.0", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC", "description": "", "devDependencies": { "parcel-bundler": "^1.12.4" }, "alias": { "process": { "global": "process" } } } html : <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="description" content="Deploy your websites in less than 60 seconds" /> <meta property="og:title" content="Edity..." /> <meta property="og:description" content="Edity..." /> <meta property="og:type" content="website" /> <meta property="og:image" content="https//..." /> <meta property="og:url" content="https//Edity..." /> <title>Edity - Go Online for just $5</title> <link rel="stylesheet" href="./CSS/styles.css" /> <link rel="stylesheet" href="./CSS/normalize.css" /> <!-- GOOGLE FONT :INTER --> <link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap" rel="stylesheet" /> <link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" /> </head> <body> <!-- Nav bar --> <header> <nav class= <script src="./JS/main.js"></script> <script src="https://unpkg.com/aos@next/dist/aos.js"></script> <script> AOS.init(); </script> </body> </html> <script src="./JS/main.js"></script> <script src="https://unpkg.com/aos@next/dist/aos.js"></script> <script> AOS.init(); </script> </body> </html>

3rd Apr 2025, 6:37 PM
Eddie
Eddie - avatar
2 Respostas
+ 1
✅ Problème : Parcel ne charge pas le CSS/JS car il ne sert pas les fichiers comme Live Server. Tes chemins (./CSS/...) sont corrects, mais Parcel veut un fichier HTML comme point d’entrée. 🔧 Solution rapide : Ouvre le terminal et tape : bash Copier Modifier parcel index.html Vérifie les dossiers : CSS et JS doivent être bien nommés (respecte les majuscules). Corrige ton HTML : Tu as un <nav> non fermé et des <script> en double. 🚀 Conseil : Passe à Parcel 2 : bash Copier Modifier npm uninstall parcel-bundler npm install --save-dev parcel npx parcel index.html
11th Jul 2025, 12:27 AM
Farmach Rayan
Farmach Rayan - avatar