I'm just trying to generate a build using parcel build /src/index.html, I'm able to build the app, but when I try to open the build form a browser, it says it is unable to access index.js from index.html after build.
<body>
<div id="root"></div>
<script src="index.js" type="module"></script>
</body>
Anyway, Im having no issues on running the project locally. Please take a look at the images below to understand my concern. Thanks.


You need to serve the dist directory from a web server.
F.I. from your terminal:
cd dist
npx serve
You can add this in scripts in package.json if it is an npm project
"build": "parcel build index.html",
This will give you an production build or simply run
npx parcel build index.html
And to run the application on local
cd dist
npx serve
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With