Skip to content

Some module resolutions breaking from 20251006 version onwards #298

@nickw1

Description

@nickw1

Describe the bug

Hi @lazarv,

I've just attempted to update lilt to the newest version of @lazarv/react-server (having been on the 20250925 version for a while) and it appears that resolution of some modules breaks from the 20251006 version onwards (i.e fix #252). This was originally done in response to problems with highlight-js though I switched to Shiki (as recommended by yourself). Ironically Shiki appears to be one of the imports which breaks.

When I try pnpm run build to build for production I encounter this build error:

> @ build /home/nick/src/lilt
> pnpm react-server build

react-server/0.0.0-experimental-6ad4f93-20251006-6a6c6e76 building rsc for production
[vite:react-babel] We recommend switching to `@vitejs/plugin-react-oxc` for improved performance. More information at https://vite.dev/rolldown
✓ 484 modules transformed.
✗ Build failed in 1.41s
Build failed with 293 errors:

[UNLOADABLE_DEPENDENCY] Error: Could not load @babel/runtime/helpers/extends
   ╭─[ node_modules/@uiw/react-md-editor/esm/commands/title.js:1:22 ]
   │
 1 │ import _extends from "@babel/runtime/helpers/extends";
   │                      ────────────────┬───────────────  
   │                                      ╰───────────────── No such file or directory (os error 2)
───╯

[UNLOADABLE_DEPENDENCY] Error: Could not load @babel/runtime/helpers/objectDestructuringEmpty
   ╭─[ node_modules/@uiw/react-md-editor/esm/commands/group.js:1:39 ]
   │
 1 │ import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
   │                                       ────────────────────────┬────────────────────────  
   │                                                               ╰────────────────────────── No such file or directory (os error 2)
───╯

[UNLOADABLE_DEPENDENCY] Error: Could not load @babel/runtime/helpers/objectWithoutPropertiesLoose
   ╭─[ node_modules/@uiw/react-md-editor/esm/Editor.js:2:43 ]
   │
 2 │ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
   │                                           ──────────────────────────┬──────────────────────────  
   │                                                                     ╰──────────────────────────── No such file or directory (os error 2)
───╯

[UNLOADABLE_DEPENDENCY] Error: Could not load @uiw/react-markdown-preview
   ╭─[ node_modules/@uiw/react-md-editor/esm/Editor.js:5:29 ]
   │
 5 │ import MarkdownPreview from '@uiw/react-markdown-preview';
   │                             ──────────────┬──────────────  
   │                                           ╰──────────────── No such file or directory (os error 2)
───╯

[UNLOADABLE_DEPENDENCY] Error: Could not load @shikijs/core
   ╭─[ node_modules/shiki/dist/index.mjs:4:15 ]
   │
 4 │ export * from '@shikijs/core';
   │               ───────┬───────  
   │                      ╰───────── No such file or directory (os error 2)
───╯

...
    at normalizeErrors (file:///home/nick/src/lilt/node_modules/.pnpm/rolldown@1.0.0-beta.30/node_modules/rolldown/dist/shared/src-DR2upIfp.mjs:2258:18)
    at handleOutputErrors (file:///home/nick/src/lilt/node_modules/.pnpm/rolldown@1.0.0-beta.30/node_modules/rolldown/dist/shared/src-DR2upIfp.mjs:2992:34)
    at transformToRollupOutput (file:///home/nick/src/lilt/node_modules/.pnpm/rolldown@1.0.0-beta.30/node_modules/rolldown/dist/shared/src-DR2upIfp.mjs:2986:2)
    at RolldownBuild.write (file:///home/nick/src/lilt/node_modules/.pnpm/rolldown@1.0.0-beta.30/node_modules/rolldown/dist/shared/src-DR2upIfp.mjs:4186:10)
    at async buildEnvironment (file:///home/nick/src/lilt/node_modules/.pnpm/rolldown-vite@7.0.12_@types+node@24.2.0_esbuild@0.25.8_sass@1.89.2_terser@5.43.1_yaml@2.8.0/node_modules/rolldown-vite/dist/node/chunks/dep-DhQ4L5z7.js:33419:52)
    at async Object.build (file:///home/nick/src/lilt/node_modules/.pnpm/rolldown-vite@7.0.12_@types+node@24.2.0_esbuild@0.25.8_sass@1.89.2_terser@5.43.1_yaml@2.8.0/node_modules/rolldown-vite/dist/node/chunks/dep-DhQ4L5z7.js:33817:19)
    at async serverBuild (file:///home/nick/src/lilt/node_modules/.pnpm/@lazarv+react-server@0.0.0-experimental-6ad4f93-20251006-6a6c6e76_@types+node@24.2.0_ac_ac51b21884c33ebe609e9636a09a7666/node_modules/@lazarv/react-server/lib/build/server.mjs:439:3)
    at async file:///home/nick/src/lilt/node_modules/.pnpm/@lazarv+react-server@0.0.0-experimental-6ad4f93-20251006-6a6c6e76_@types+node@24.2.0_ac_ac51b21884c33ebe609e9636a09a7666/node_modules/@lazarv/react-server/lib/build/action.mjs:61:39

ⅹ Build failed in 1.76s

Thanks.

Reproduction

https://github.com/nickw1/lilt

Steps to reproduce

Clone lilt
pnpm install
pnpm run build

System Info

System:
    OS: Linux 6.8 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
    CPU: (16) x64 13th Gen Intel(R) Core(TM) i5-1340P
    Memory: 27.61 GB / 31.05 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 22.14.0 - /usr/local/node/bin/node
    npm: 11.3.0 - /usr/local/node/bin/npm
    pnpm: 10.12.1 - /usr/local/node/bin/pnpm
    bun: 1.3.2 - /home/nick/.bun/bin/bun
    Deno: 2.5.6 - /home/nick/.deno/bin/deno
  Browsers:
    Chrome: 142.0.7444.175
    Firefox: 146.0
    Firefox Developer Edition: 146.0
  npmPackages:
    @lazarv/react-server: (any version from 20251006 onwards)
    vite: ^6.3.5 => 6.3.5

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions