Skip to content

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

@Enable-Lukas

Description

@Enable-Lukas

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions