Hello,
I am having trouble deployement a simple app using parcel js.
I used the command: parcel build index.html
I have 1 html file that includes 1 js file.:
<script src="index.js" type="module"></script>
This js file imports 2 js files:
import Select from './js/select.js';
import Tile from './js/tile.js';
import {destinations} from './data/destinations.js';
After the build, I opened the index.html file and get 2 errors in the console:
error: 1
Blocage d’une requête multiorigines (Cross-Origin Request) : la politique « Same Origin » ne permet pas de consulter la ressource distante située sur file:///destinations.1c7ea528.js. Raison : la requête CORS n’utilise pas http.
error 2
L’URI de la source du module n’est pas autorisé dans ce document : « file:///destinations.1c7ea528.js ».
The errors are in French but I think you get the idea, something about CORS.
Here is the package.jon file:
{
"name": "destinations",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"js": "^0.1.0",
"partials": "^0.1.0",
"reset.css": "^2.0.2",
"sass": "^1.26.5",
"typography.css": "^0.1.0"
},
"devDependencies": {
"cssnano": "^4.1.10"
}
}
Can anyone try to help me figure this out ?
Thanks a lot