You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Suggestion: Use InternalScope.scope instead of this.scope in static field arrow functions for Turbopack compatibility #1643
Under Turbopack (Next.js 16 dev mode), the arrow function's lexical this binding is lost during transpilation, producing a module-level _this = void 0 and crashing with TypeError: Cannot read properties of undefined (reading 'scope').
Suggested fix — Convert to static method declarations (or use InternalScope.scope explicitly):
This is a defensive workaround for a Turbopack dev-mode transpilation bug tracked at: vercel/next.js#96254
This is not a bug in arktype — the code is valid ES2022. Instance field arrow functions (lines 1795–1848) are transpiled correctly because Turbopack wraps them in IIFEs with proper _this capture. Only static field arrows are affected by the Turbopack issue.
Activity
pullfrog commentedon Jul 27, 2026
ssalbdivad commentedon Oct 1, 2026
Good catch, thanks! Fixed in #1674, going out with 2.2.7.
fix: Hermes withPrefixKey crash and Turbopack static `this` in scope.…
release: arktype 2.2.7 + dependents (#1675)