我正在尝试创建一个react-typescript应用程序以及传单。我使用了命令,
npm install leaflet react-leaflet @types/react @types/leaflet --save
安装依赖项。
但是当我启动应用程序时,它说,
./node_modules/@react-leaflet/core/esm/path.js 10:41
Module parse failed: Unexpected token (10:41)
File was processed with these loaders:
* ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| useEffect(function updatePathOptions() {
| if (props.pathOptions !== optionsRef.current) {
> const options = props.pathOptions ?? {};
| element.instance.setStyle(options);
| optionsRef.current = options;
Run Code Online (Sandbox Code Playgroud)
这是我的 package.json
{
"name": "aq-monitor",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.12.0",
"@testing-library/react": …
Run Code Online (Sandbox Code Playgroud)