Replies: 1 comment 4 replies
-
It looks like |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
@arcgis/core
is an NPM ESM package. I'm trying to figure out if this bug is with SvelteKit or if I need to contactArcGis
.@arcgis/core
works fine with Vite and NextJS.Importing from
MapView
from@arcgis/core
creates the error below as this sandbox demonstratesAt first I thought this issue had to do with Vite. So I imported @arcgis/core in vite as this tutorial shows. It works fine.
When I tried to debug further I realized
calcite-components
is a Stencil project which does include ESM, though the error states the package is CommonJS (it does not have"type": "module"
in the package.json and the import is not from theesm
folder). Either way, the error itself had a recommended fix. When I go into the problem file and apply the fixnode_modules/@arcgis/core/widgets/support/componentsUtils.js
it fixes the issue. Then a new one is created, which I believe is different, in the file
node_modules/@arcgis/core/widgets/support/chartUtils.js:
The first line of that file is
import{chartColorSets as t}from"@esri/calcite-colors";
which produces the error
This is strange to me because
calcite-colors
is ESM and does have named exports. If I remove all the imports from@arcgis/core
and just copy / pasteimport{chartColorSets as t}from"@esri/calcite-colors"
into my index.svelte it works fine.A Vite project work just fine but SvelteKit reports
calcite-colors
does not have a named export only when it is imported via@arcgis/core
.Others have had this issue on the esri forums
Reproduction
Create a new SvelteKit project, run
npm install @arcgis/core
, then modifyindex.svelte
toLogs
No response
System Info
Severity
blocking all usage of SvelteKit
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions