Skip to content

ERR_UNSUPPORTED_DIR_IMPORT node_modules/@atlaskit/pragmatic-drag-and-drop/combine' is not supported #175

Open
@Blankeos

Description

This only happens when I statically build my Vike app for a static host.

I know Vike is a lesser known framework so I'm not sure if it's a Vike issue or just a bundling issue on pragmatic-drag-and-drop.

Repro: Blankeos/car-finance-calculator#2

  1. bun install
  2. bun run build
  3. You should get this error:
vike v0.4.210 pre-rendering HTML...
Error: Directory import '/Users/carlo/Desktop/Projects/car-finance-calculator/node_modules/@atlaskit/pragmatic-drag-and-drop/combine' is not supported resolving ES modules imported from /Users/carlo/Desktop/Projects/car-finance-calculator/dist/server/entries/src_pages_index.mjs
Did you mean to import "@atlaskit/pragmatic-drag-and-drop/dist/cjs/entry-point/combine.js"?
    at finalizeResolution (node:internal/modules/esm/resolve:259:11)
    at moduleResolve (node:internal/modules/esm/resolve:933:10)
    at defaultResolve (node:internal/modules/esm/resolve:1169:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:542:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:510:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:96:40)
    at link (node:internal/modules/esm/module_job:95:36) {
  code: 'ERR_UNSUPPORTED_DIR_IMPORT',
  url: 'file:///Users/carlo/Desktop/Projects/car-finance-calculator/node_modules/@atlaskit/pragmatic-drag-and-drop/combine

This only happens when vite.config.ts has:

export default defineConfig({
   plugins: [
      // I need this so that it creates an index.html since I deploy to Cloudflare pages or Netlify.
      vike({ prerender: true }), 
   ]
});

It doesn't happen when:

export default defineConfig({
   plugins: [
      vike(),
   ]
});

Any idea why this is happening?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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