Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[pull] canary from vercel:canary #135

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

Merged
merged 1 commit into from
May 17, 2025
Merged

[pull] canary from vercel:canary #135

merged 1 commit into from
May 17, 2025

Conversation

pull[bot]
Copy link

@pull pull bot commented May 17, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

Dynamic import tracking should never be applied to edge runtime code,
because:
1. `dynamicIO` prerendering is not supported for edge
2. the implementation of `dynamicIO` prerendering relies on
node-specific APIs.

I missed this in #74152. This PR fixes a couple things:
- We no longer apply the dynamic import tracking to any edge modules
- Just to be safe, `trackDynamicImport` and `new CacheSignal` will now
throw if it's called from the edge runtime
- However, if `track-module-loading` does end up in an edge module, we
don't want to error at the top-level when creating
`moduleLoadingSignal`, so it is now initialized lazily. This is a bit
ugly, but `AppRouteRouteModule` currently pulls all prerendering-related
code in at the top level (instead of e.g. a conditional `require()` when
prerendering), so it *is* included in edge route handlers, even if
unused.
- this also required changing `__next_require__`/`__next_chunk_load__`
to only track module loading in DIO prerenders, otherwise we'd attempt
to create `moduleLoadingSignal` in edge RSC too

I also fixed a potential unhandled rejection in `CacheSignal.trackRead`,
because `.finally` rejects even if the original error was caught
somewhere else. (thanks for finding this one @gnoff!)
@pull pull bot added the ⤵️ pull label May 17, 2025
@pull pull bot merged commit f270834 into code:canary May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant