[NEXT-1254] Shorthand notation not working in actions #50445
Labels
bug
Issue was opened via the bug report template.
linear: next
Confirmed issue that is tracked by the Next.js team.
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.4.0: Mon Mar 6 21:00:41 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T8103 Binaries: Node: 16.17.0 npm: 8.15.0 Yarn: 1.22.17 pnpm: 7.14.2 Relevant packages: next: 13.4.5-canary.0 eslint-config-next: 13.4.3 react: 18.2.0 react-dom: 18.2.0 typescript: 5.0.4
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue or a replay of the bug
https://github.com/thanosoncode/next-blog/blob/master/app/page.tsx
To Reproduce
Create a List component that renders a list and a DeleteForm that handles item delete using actions.
Describe the Bug
If shorthand notation is used in:
await prisma.post.delete({ where: { id } });
we get an unhandledErrorError: id is not defined
If explicit notation is used in:
await prisma.post.delete({ where: { id : id } });
everything works as expectedScreen.Recording.2023-05-27.at.7.44.47.AM.mov
Expected Behavior
Shorthand notation to work in actions.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
NEXT-1254
The text was updated successfully, but these errors were encountered: