最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

node.js - nextjs crash when running on arm64 - Stack Overflow

programmeradmin0浏览0评论

developed a small landing page on x86 using basic nextjs default typescript application. Only added @clerk and winston logs besides the default skeleton.

Pushed it to a arm64 server and I can run dev:

> next dev -p 3000

   ▲ Next.js 15.2.4
   - Local:        http://localhost:3000
   - Network:      http://135.181.197.124:3000
   - Environments: .env
   - Experiments (use with caution):
     ✓ authInterrupts

 ✓ Starting...
 ✓ Ready in 2.3s
 ✓ Compiled /middleware in 213ms
 ✓ Compiled (213 modules)
 ○ Compiling / ...
 ✓ Compiled / in 24.6s (2596 modules)
2025-04-03T12:06:28.730Z WWW [info] logs from my application

i can also build it

> next build

   ▲ Next.js 15.2.4
   - Environments: .env
   - Experiments (use with caution):
     ✓ authInterrupts

   Creating an optimized production build ...
 ✓ Compiled successfully
 ✓ Linting and checking validity of types    
 ✓ Collecting page data    
2025-04-03T12:07:48.228Z WWW [info] ACL: OPEN NaN.⁀
 ✓ Generating static pages (5/5)
 ✓ Collecting build traces    
 ✓ Finalizing page optimization    

Route (app)                                 Size  First Load JS    
┌  /                                    1.01 kB         144 kB
└  /_not-found                            978 B         101 kB
+ First Load JS shared by all             101 kB
  ├ chunks/3bd1b696-7ce94265d3483044.js  53.2 kB
  ├ chunks/284-986f9a475d6800c8.js       45.3 kB
  └ other shared chunks (total)          1.98 kB


 Middleware                             69.5 kB

  (Dynamic)  server-rendered on demand

but start fails:

> next start -p 3000

   ▲ Next.js 15.2.4
   - Local:        http://localhost:3000
   - Network:      http://135.181.197.124:3000

 ✓ Starting...
 ✓ Ready in 783ms
(issue a request to `/`)
2025-04-03T12:08:13.435Z WWW [info] logs from my application
 ⨯ Error: Clerk: auth(), currentUser() and clerkClient(), are only supported in App Router (/app directory).
If you're using /pages, try getAuth() instead.
Original error: TypeError: Cannot read properties of undefined (reading 'bind')
    at i (.next/server/chunks/486.js:62:44038)
    at async Object.E (.next/server/chunks/486.js:50:85070)
    at async f (.next/server/app/page.js:22:13184)
    at async M (.next/server/app/page.js:22:16244) {
  digest: '3964549687'
}
^C

I cannot reproduce it on x86_64. Already matched versions of everything. (originally developed on nodejs-23, arm is running nodejs v18.19.0).

the crash occurs on:

//  node_modules/@clerk/nextjs/dist/cjs/app-router/server/utils.js:48
async function buildRequestLike() {
  try {
    const { headers } = await import("next/headers");
    const resolvedHeaders = await headers();
    return new import_server.NextRequest(";, { headers: resolvedHeaders }); 
  }

but since it only happens on start not on dev I am having a hard time to trace it back to the nextjs code show on the traceback with the 'compiled' code.

发布评论

评论列表(0)

  1. 暂无评论