以下这个。
我的 package.json 中有以下内容:
{
"name": "cesium-deckgl-viewer-vite",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"devDependencies": {
"typescript": "~5.6.2",
"vite": "^6.0.1"
},
"dependencies": {
"@deck.gl/core": "^9.0.38",
"@deck.gl/geo-layers": "^9.0.38",
"@deck.gl/mapbox": "^9.0.38",
"@loaders.gl/3d-tiles": "^4.3.3",
"@loaders.gl/core": "^4.3.3",
"@probe.gl/log": "^4.0.9",
"mapbox-gl": "^3.8.0"
}
}
在我的index.js中:
import {MapboxLayer} from '@deck.gl/mapbox';
但是它给了我错误:
Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/@deck__gl_mapbox.js?v=5cb1e8a3' does not provide an export named 'MapboxLayer'
我的设置中缺少什么?