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/coreis an NPM ESM package. I'm trying to figure out if this bug is with SvelteKit or if I need to contactArcGis.@arcgis/coreworks fine with Vite and NextJS.Importing from
MapViewfrom@arcgis/corecreates 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-componentsis 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 theesmfolder). 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.jsit 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-colorsis ESM and does have named exports. If I remove all the imports from@arcgis/coreand 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-colorsdoes 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.sveltetoLogs
No response
System Info
System: OS: macOS 13.0 CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 268.04 MB / 16.00 GB Shell: 3.3.1 - /usr/local/bin/fish Binaries: Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node Yarn: 1.22.17 - /usr/local/bin/yarn npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm Browsers: Brave Browser: 103.1.40.105 Chrome: 103.0.5060.53 Firefox: 101.0.1 Safari: 16.0 npmPackages: @sveltejs/adapter-auto: next => 1.0.0-next.51 @sveltejs/kit: next => 1.0.0-next.352 svelte: ^3.48.0 => 3.48.0Severity
blocking all usage of SvelteKit
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions