codehike: Error occur when build with next-mdx-remote and next.js standalone option

Context

Hi!! Thank you for building and maintaining such a great package. I am encountering some issues when using codehike + next-mdx-remote + Nextjs with the standalone option.

During development, the code goes smoothly. But after building it with the Next.js standalone option, the app can’t find some file that codehike relied on and throw Internal Error.

error running remarkCodeHike [Error: ENOENT: no such file or directory, open '/app/node_modules/.pnpm/shiki@0.10.1/node_modules/shiki/languages/abap.tmLanguage.json'] {
code-hike-test-2 |   errno: -2,
code-hike-test-2 |   code: 'ENOENT',
code-hike-test-2 |   syscall: 'open',
code-hike-test-2 |   path: '/app/node_modules/.pnpm/shiki@0.10.1/node_modules/shiki/languages/abap.tmLanguage.json'
code-hike-test-2 | }

The way to reproduce

  1. Please clone this repo https://github.com/EiffelFly/code-hike-remote-docker
  2. install everything and use the script npm run build
  3. Activate the standalone server with node ./.next/standalone/server.js
  4. goto http://localhost:3000

I have set up a docker image if this could help.

  1. npm run docker:app:develop
  2. goto http://localhost:3000

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 21 (8 by maintainers)

Commits related to this issue

Most upvoted comments

should be fixed with v0.8.0, let me know how it goes