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

Error when running cookies() from next/headers - Error: (0 , _requestasyncstorageexternal.getExpectedRequestStore) is not a function #65827

Open
caioalmeida12 opened this issue May 15, 2024 · 1 comment
Labels
bug Issue was opened via the bug report template. Module Resolution Module resolution (CJS / ESM, module resolving) Navigation Related to Next.js linking (e.g., <Link>) and navigation. Runtime Related to Node.js or Edge Runtime with Next.js.

Comments

@caioalmeida12
Copy link

Link to the code that reproduces this issue

https://github.com/caioalmeida12/sisref-v2-dashboard/tree/110-instalar-docker

To Reproduce

  1. Build the dockerfile: docker build -t sisref-v2-dashboard .
  2. Run the docker container: docker run --rm -it -p 3000:3000/tcp sisref-v2-dashboard:latest
  3. Access the page: http://localhost:3000

Current vs. Expected behavior

Currently, instead of being able to access the page, it crashes upon request to the / route. It compiles the middlewares perfectly, tho.

Provide environment information

C:\Users\caiod\AppData\Roaming\nvm\v12.22.12\node_modules\npm\lib\cli\validate-engines.js:31
    throw err
    ^

TypeError: Class extends value undefined is not a constructor or null
    at Object.<anonymous> (C:\Users\caiod\AppData\Roaming\nvm\v12.22.12\node_modules\npm\node_modules\fs-minipass\lib\index.js:136:4)
    at Module._compile (node:internal/modules/cjs/loader:1434:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1518:10)
    at Module.load (node:internal/modules/cjs/loader:1249:32)
    at Module._load (node:internal/modules/cjs/loader:1065:12)
    at Module.require (node:internal/modules/cjs/loader:1271:19)
    at require (node:internal/modules/helpers:123:16)
    at Object.<anonymous> (C:\Users\caiod\AppData\Roaming\nvm\v12.22.12\node_modules\npm\lib\utils\log-file.js:3:20)
    at Module._compile (node:internal/modules/cjs/loader:1434:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1518:10)

Node.js v22.2.0

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Enterprise
  Available memory (MB): 30614
  Available CPU cores: 12
Binaries:
  Node: 22.2.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.2.3 // Latest available version is detected (14.2.3).
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.4.5
Next.js Config:
  output: N/A

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

Module Resolution, Navigation, Runtime

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

next dev (local)

Additional context

I tested running on Node 20.13 LTS, but didnt work as well.
I cant figure out why my NPM base command wont work, tho. I've been falling back to bun, which works perfectly. Might be related.

@caioalmeida12 caioalmeida12 added the bug Issue was opened via the bug report template. label May 15, 2024
@github-actions github-actions bot added Module Resolution Module resolution (CJS / ESM, module resolving) Navigation Related to Next.js linking (e.g., <Link>) and navigation. Runtime Related to Node.js or Edge Runtime with Next.js. labels May 15, 2024
@IonelLupu
Copy link

I got the same error after migrating from NextJS 13 to NextJS 14 and when running lighthouse. But I cannot replicate locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Module Resolution Module resolution (CJS / ESM, module resolving) Navigation Related to Next.js linking (e.g., <Link>) and navigation. Runtime Related to Node.js or Edge Runtime with Next.js.
Projects
None yet
Development

No branches or pull requests

2 participants