Skip to content

Error occur when build with next-mdx-remote and next.js standalone option #283

@EiffelFly

Description

@EiffelFly

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/[email protected]/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/[email protected]/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

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