forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
turbopack: Fix Server Actions in Edge runtime (vercel#57462)
### What? Changes Server Actions to use a lazy `require()` statement instead of a lazy dynamic `import()`, to fix SA in the Edge runtime. ### Why? The Edge runtime has a restriction that it's not allowed to lazy load more files. The problem is that dynamic `import()` does exactly that, it defers importing those files until the call time. `require()` doesn't have this issue, because the chunks it would load are included instead of deferred. ### How? Just needed to modify the actions loader entry point… after hours of trying to get the action loader to evaluate in the node runtime and then import the actions in the edge runtime. Closes WEB-1874
- Loading branch information
1 parent
6688201
commit 7c0e66f
Showing
2 changed files
with
9 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters