Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Named export 'group' not found. The requested module 'd3-array' is a CommonJS module, #449

Open
Enable-Lukas opened this issue Sep 24, 2024 · 1 comment

Comments

@Enable-Lukas
Copy link

unovis/svelte version: 10.8.1
unovis/ts version: 10.8.1
sveltejs/kit: 2.5.24

What I was doing:

I was installing a module from shadcn-svelte, which includes an import for @unovis/svelte.
I installed it using npm i @unovis/svelte.
After installing and importing it into my codebase, I encountered the error.

 Named export 'group' not found. The requested module 'd3-array' is a CommonJS module, which may not support all module.exports as named exports.
  CommonJS modules can always be imported via the default export, for example using:
  
  import pkg from 'd3-array';
  const { group, index } = pkg;
  
  import { group, index } from 'd3-array';
           ^^^^^
  SyntaxError: Named export 'group' not found. The requested module 'd3-array' is a CommonJS module, which may not support all module.exports as named exports.
  CommonJS modules can always be imported via the default export, for example using:
  
  import pkg from 'd3-array';
  const { group, index } = pkg;

at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async nodeImport (file:///C:/Users/l-brostering/VS%20Code/Frontend/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:52954:15)
at async ssrImport (file:///C:/Users/l-brostering/VS%20Code/Frontend/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:52812:16)
at async eval (eval at instantiateModule (file:///C:/Users/l-brostering/VS%20Code/Frontend/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:52861:24), <anonymous>:4:31)
at async instantiateModule (file:///C:/Users/l-brostering/VS%20Code/Frontend/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:52870:5

I hope this was helpfull to fix the error it is my first issue. If you have anymore questents free to ask i try to help as good as i can.
Thx for you time.

@rokotyan
Copy link
Contributor

Looks like a dependency collision with some of the other libraries you may be using.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants