-
🆘 Error descriptionWhen running this code: import React from "react";
import { MapContainer, TileLayer } from "react-leaflet";
const Map = () => {
const position = [45.52007, -122.79014];
return (
<MapContainer center={position} zoom={13} animate={true}>
{" "}
<TileLayer
attribution='© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> © <a href="http://cartodb.com/attributions">CartoDB</a>'
url="https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"
/>{" "}
</MapContainer>
);
};
export default Map; I am getting the following network message: 🖥️ Configuration
package.json {
"name": "bikey-tracking-web",
"version": "1.0.0",
"description": "Bikey tracking web application for users and administrators",
"main": "dist/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "npm-run-all --parallel watch:start watch:css",
"watch:start": "parcel serve ./public/index.html",
"watch:css": "tailwindcss -i ./src/index.css -o src/assets/tailwind/tailwind.css --watch",
"build": "yarn execute:css && yarn execute:build",
"execute:build": "parcel build ./public/index.html --target default",
"execute:css": "export NODE_ENV=production || SET NODE_ENV=production && tailwindcss -i ./src/index.css -o src/assets/tailwind/tailwind.css --minify",
"init:amplify": "amplify init && amplify import auth && amplify push",
"restart:amplify": "amplify remove auth && amplify import auth && amplify push"
},
"keywords": [],
"author": "IAS I+D+I Bikey",
"license": "ISC",
"devDependencies": {
"@babel/runtime": "^7.15.3",
"@parcel/packager-raw-url": "^2.0.0-rc.0",
"@parcel/transformer-image": "^2.0.0-rc.0",
"@parcel/transformer-webmanifest": "^2.0.0-rc.0",
"autoprefixer": "^10.3.4",
"cssnano": "^5.0.8",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-standard": "^16.0.3",
"eslint-import-resolver-parcel2": "^1.0.1",
"eslint-plugin-import": "^2.24.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"npm-run-all": "^4.1.5",
"parcel": "^2.0.0-rc.0",
"postcss": "^8.3.6",
"postcss-import": "^14.0.2",
"postcss-modules": "^4.2.2",
"prettier": "^2.3.2",
"tailwindcss": "^2.2.7"
},
"dependencies": {
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
"aws-amplify": "^4.2.4",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-leaflet": "^3.2.1",
"react-lottie": "^1.2.3",
"react-router-dom": "^5.2.1"
},
"browserslist": {
"production": [
"last 2 chrome version",
"last 2 firefox version",
"last 2 safari version"
],
"development": [
"last 2 chrome version",
"last 2 firefox version",
"last 2 safari version"
]
},
"targets": {
"default": {}
}
} 🤔 How to solve this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I can't remember where I got this solution from but create a file in the root of your project called ".proxyrc.js" and paste the following in:
Let me know if that works! If someone could advise me on why this works for me? I am not sure why it does. |
Beta Was this translation helpful? Give feedback.
-
Yes but by disabling those headers you'll get the famous sharedArrayBuffer missing in browser. |
Beta Was this translation helpful? Give feedback.
I can't remember where I got this solution from but create a file in the root of your project called ".proxyrc.js" and paste the following in:
Let me know if that works!
If someone could advise me on why this works for me? I am not sure why it does.