Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module '@libsql/darwin-arm64' in standalone build #10484

Open
janeumnn opened this issue Jan 9, 2025 · 0 comments
Open

Cannot find module '@libsql/darwin-arm64' in standalone build #10484

janeumnn opened this issue Jan 9, 2025 · 0 comments
Labels
status: needs-triage Possible bug which hasn't been reproduced yet

Comments

@janeumnn
Copy link

janeumnn commented Jan 9, 2025

Describe the Bug

Hi,

I am trying to get a standalone build working with @payloadcms/db-sqlite. However, neither running the build natively nor using a container with the provided Dockerfile template works for me. For example, when I attempt to access the initial /admin/create-first-user route after starting the native build, I encounter the following error:

# node server.js
   ▲ Next.js 15.1.4
   - Local:        http://localhost:3000
   - Network:      http://0.0.0.0:3000

 ✓ Starting...
 ✓ Ready in 243ms
[Error: Cannot find module '@libsql/darwin-arm64'
Require stack:
- /Users/***/***/app/node_modules/.pnpm/[email protected]/node_modules/libsql/index.js] {
  code: 'MODULE_NOT_FOUND',
  requireStack: [Array]
}
 ⨯ unhandledRejection:  [Error: Cannot find module '@libsql/darwin-arm64'
Require stack:
- /Users/***/***/app/node_modules/.pnpm/[email protected]/node_modules/libsql/index.js] {
  code: 'MODULE_NOT_FOUND',
  requireStack: [Array]
}

I have also tried including @libsql/client and libsql as project dependencies, as previously mentioned in #7527, it did not resolve the issue for me. Upon inspecting the node_modules directory in the resulting build, I noticed that the prebuilt binary package for @libsql is missing. This leads me to suspect that the issue might be related to the standalone bundling process in Next.js.

@DanRibbens

Link to the code that reproduces this issue

https://github.com/janeumnn/payload-reproduction-bug

Reproduction Steps

  1. Clone the repository.
  2. Navigate to the project directory: cd payload-reproduction-bug && pnpm install.
  3. Build the project: pnpm build.
  4. Copy the static assets: cp -r .next/static .next/standalone/.next/.
  5. Move the standalone folder to a different location to avoid interference with the installed project dependencies.
  6. Navigate to the new location of the standalone build.
  7. Start the server: node server.js.

Which area(s) are affected? (Select all that apply)

db-sqlite

Environment Info

Node.js v20.14.0

Binaries:
  Node: 20.14.0
  npm: 10.7.0
  Yarn: N/A
  pnpm: 9.1.3
Relevant Packages:
  payload: 3.15.1
  next: 15.1.0
  @payloadcms/db-sqlite
  @payloadcms/email-nodemailer: 3.15.1
  @payloadcms/graphql: 3.15.1
  @payloadcms/next/utilities: 3.15.1
  @payloadcms/payload-cloud: 3.15.1
  @payloadcms/richtext-lexical: 3.15.1
  @payloadcms/translations: 3.15.1
  @payloadcms/ui/shared: 3.15.1
  react: 19.0.0
  react-dom: 19.0.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.2.0: Fri Dec  6 19:01:59 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 8
@janeumnn janeumnn added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs-triage Possible bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

1 participant