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 not being thrown for non-async server side arrow functions #63580

Open
DiskCrasher opened this issue Mar 21, 2024 · 0 comments
Open

Error not being thrown for non-async server side arrow functions #63580

DiskCrasher opened this issue Mar 21, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template. Runtime Related to Node.js or Edge Runtime with Next.js.

Comments

@DiskCrasher
Copy link

Link to the code that reproduces this issue

https://github.com/DiskCrasher/next-js-issue

To Reproduce

  1. Run yarn dev.
  2. Browse to http://localhost:3000.
  3. Observe "Server actions must be async functions" error for function bar in file ssc.tsx.
  4. Delete or comment out bar function.
  5. Repeat steps above and observe that similar error is not shown for foo function even though it's not async.

Current vs. Expected behavior

The "Server actions must be async functions" error should appear for both functions.

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Home
  Available memory (MB): 8050
  Available CPU cores: 4
Binaries:
  Node: 20.11.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.2.0-canary.35 // Latest available version is detected (14.2.0-canary.35).
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: N/A

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

Middleware / Edge (API routes, runtime)

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

next dev (local), next start (local)

Additional context

No response

@DiskCrasher DiskCrasher added the bug Issue was opened via the bug report template. label Mar 21, 2024
@github-actions github-actions bot added the Runtime Related to Node.js or Edge Runtime with Next.js. label Mar 21, 2024
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. Runtime Related to Node.js or Edge Runtime with Next.js.
Projects
None yet
Development

No branches or pull requests

1 participant