Comments (6)
The issue is caused by the stricter use server
check in the recent 14.1.2 update, it seems to me NextJS is performing syntax-level checking which might raise some false errors. It actually breaks my server action builder package.
Repro: https://github.com/chungweileong94/next-use-server-bug
from next.js.
Its worth noting that this currently breaks the example shown in the documentation around using React.cache currently: https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#fetching-data-on-the-server-with-third-party-libraries
from next.js.
yeah, i had to make sure i used the export async function(return somepromise)
syntax, as export const = async () => { await ... }
would not work
from next.js.
It seems like NextJS is doing action.constructor.name !== 'AsyncFunction'
check, however, if the action is created via a library, it will get transpiled into Promise<...>
instead of action.constructor.name !== 'AsyncFunction'
. The only workaround now is to create a async function wrapper around, which is kinda annoying.
from next.js.
This is a duplicate of #62860 - please give #62860 (comment) and #62821 a read. We'll keep everyone updated there.
Basically it does not make sense to use React.cache
together with Server Actions and it will not cache anything.
from next.js.
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
from next.js.
Related Issues (20)
- Build very slow: 30+ minutes with Vercel and 10+ minutes with Laptop HOT 9
- pdfjs-dist fails to compile with Turbopack (webpackIgnore comment not respected) HOT 1
- Parallel routes breaks completely after being redirected from a server action function
- Cannot build with URL.canParse function HOT 13
- Can't build project - TypeError: Cannot read properties of null (reading 'useContext') HOT 3
- Dockerfile [4/4] Step 6/14 - /app/public no such file or directory HOT 2
- Cannot build in versions after [email protected]
- Property overrideSrc of image component (next/image) does not override srcset property HOT 2
- Next Build fails with start <= end assertion failed HOT 3
- Unused dependencies in standalone build using storybook
- Warning: React does not recognize the `fetchPriority` prop on a DOM element. HOT 1
- Error occurred prerendering page "/_not-found" with pageExtensions option HOT 8
- `next/og` cause memory leak in production standalone build HOT 1
- Multiple loading.tsx files causes extra transition when revalidating with server actions on 14.2.x+
- No official way to enable turbopack with custom server
- CSS order incorrect with the combination of server and client components HOT 3
- next.js typescript plugin autocomplete not working for `viewport`
- [Parallel and Intercepted Dynamic Routes] Will intercept normal routing HOT 2
- output export ssg generation for dynamic even with generateStaticParams id value is comming as %5Bslug%5D so page is not generated in build HOT 1
- Docs: Some Tags in "Layouts and Templates" page are not showing properly in the Firefox browser HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from next.js.