Deployed Not allowed to load local resource

After the project engineering was deployed to the server, an error was reported: vab-chunk-cc5ac5d2.c9f8eeb4.js:6 Not allowed to load local resource: file:///D:/workspace/mete/node_modules/@cesium/engine/Source/Core/Assets/approximateTerrainHeights.json。May I ask how to solve this?

Hi @HelloKitty_Yards ,

Thanks for your post and for being a part of the Cesium community.

This could be a CORS issue with your server. We often see this type of error when trying to load local files in CesiumJS due the restrictions in modern browsers on accessing local files.

You can check the configurations of how you are serving the files.

For instance, if you use a local npm server for development you can bypass cors restrictions usiong the followinf CLI settings:

npm install -g http-server
cd C:/tileset
http-server -p 8080 --cors

Please let us know if that is helpful and if you need further help resolving this.
Best,
Luke