Select to view content in your preferred language

JSON not loading in dev environment

651
2
Jump to solution
09-28-2021 12:21 PM
lakshmanankrishnan
Emerging Contributor

I am using the JavaScript API within a Vue CLI project. I get the following errors when the attribution, zoom, and pop up widgets load. These errors popup only when I use the the dev server that is provided with Vue CLI. 

Capture.PNG

The above errors go away when the project is built and served on a web sever like IIS/Apache.

I understand this is a MIME type issue. What can I do to get these errors go away in my dev environment?

 

0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Honored Contributor

Are you trying to copy the assets locally? Can you provide a repo app, you might need to play with the config.assetsPath if you want the assets locally. Here is a demo app using vue3, the JSAPI and local assets.

https://github.com/odoe/vue-jsapi-calcite

I haven't run into MIME type issue with the cli server before, it's usually how the assets are being copied and referencing them correctly.

View solution in original post

0 Kudos
2 Replies
ReneRubalcava
Honored Contributor

Are you trying to copy the assets locally? Can you provide a repo app, you might need to play with the config.assetsPath if you want the assets locally. Here is a demo app using vue3, the JSAPI and local assets.

https://github.com/odoe/vue-jsapi-calcite

I haven't run into MIME type issue with the cli server before, it's usually how the assets are being copied and referencing them correctly.

0 Kudos
lakshmanankrishnan
Emerging Contributor
It ended up being an assetspath issue. I have fixed it. Thanks.
-lak krishnan

0 Kudos