Known issues with the Module Runner #18717
sheremet-va
started this conversation in
Feedback
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The current Vite SSR transform has some unaddressed, but known issues.
The getter approach has at least two known disadvantages:
The debugger has to step into the getter when the export is accessed, which is inconvenient and confusing. (Another issue with the debugger not listed here is that "context variables" are listed as
__vite_ssr_export__
instead of the actual imported names) This approach is also slow when user code accesses the variable - this is especially visible in the benchmarking feature of Vitest.Module Runner is a CJS-style wrapper around the user code that supports top-level asynchronous execution. This, unfortunately, breaks circular imports because we don't have separate phases for linking and evaluation.
Users cannot define their own
Object
in the top level of their module because we expect to to be the globalObject
Beta Was this translation helpful? Give feedback.
All reactions