Repository navigation
fix(next-plugin): honor debug, restore session state whole and warn on setup fallbacks - #918
Merged
Merged
Conversation
…n setup fallbacks Three gaps in the Turbopack setup: - The `debug` option was ignored: the Turbopack branch never read it or called `setDebug`, unlike the webpack path. It is now set on the engine and is part of the production setup cache key. - A dev restart imported the sheet, class map and file map one after another in a single `try`. When a later file was missing or corrupt, the earlier ones stayed imported, and new styles could get names that clash with the restored ones. Every file is now read and parsed first, then all are imported; state that does not import is dropped with `resetBuildState`. The prefix and debug flag are set after the restore so a drop keeps them. - A failing import graph or file-numbering scan was swallowed, leaving a successful build without class merging, with idle-based CSS completion or with arrival-order file numbers. Both now print a warning with the cause and what the build loses. Refs #686 (NXT-10, NXT-14, NXT-18) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
This was referenced Nov 15, 2026
owjs3901
added a commit
that referenced
this pull request
Nov 17, 2026
#918 restores session state through restoreSessionState; keep calling it with the shared distDir files, so a process with its own state dir still starts from what the cache was built against. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes NXT-10, NXT-14, and NXT-18 from #686. All are in the Next.js Turbopack setup stage (
plugin.ts).debugoption and did not callsetDebug. Unlike the webpack path,debug: truewas ignored. It is now set on the engine and also included in the production config cache key.try. If a later file was missing or corrupt, a state with only the earlier files imported was left behind, and new styles could get names that collide with restored names.restoreSessionState).resetBuildState()and starts fresh.Remaining
New errors
None. New warnings:
[devup-ui] Turbopack import graph failed: <cause>. Classes are not merged across files only one module imports, and the production stylesheet waits for extraction to go quiet instead of for every compiled file.[devup-ui] Turbopack file numbering failed: <cause>. Stylesheet file numbers follow the order Turbopack compiles files in, so they can differ between builds of the same source.Test plan
plugin.test.ts:setDebugcalls for the default anddebug: true, the warning text for import graph and number scan failures,restoreSessionState(one file missing / one corrupt / import fails →resetBuildState). 100% coverage forplugin.ts@typescript/nativetsc passes요약
#686의 NXT-10, NXT-14, NXT-18을 고칩니다. 모두 Next.js Turbopack 설정 단계(
plugin.ts)입니다.debug옵션을 읽지 않았고setDebug도 부르지 않았습니다. webpack 경로와 달리debug: true가 무시됐습니다. 이제 엔진에 설정하고, 프로덕션 설정 캐시 키에도 넣습니다.try안에서 차례로 import했습니다. 뒤 파일이 없거나 깨지면 앞 파일만 들어간 상태가 남아, 새 스타일이 복원된 이름과 겹치는 이름을 받을 수 있었습니다.restoreSessionState).resetBuildState()로 버리고 새로 시작합니다.남은 것
새로 생기는 오류
없음. 새 경고:
[devup-ui] Turbopack import graph failed: <cause>. Classes are not merged across files only one module imports, and the production stylesheet waits for extraction to go quiet instead of for every compiled file.[devup-ui] Turbopack file numbering failed: <cause>. Stylesheet file numbers follow the order Turbopack compiles files in, so they can differ between builds of the same source.테스트 계획
plugin.test.ts: 기본값·debug: true의setDebug호출, import graph·번호 스캔 실패 경고 문구,restoreSessionState(파일 하나 없음 / 하나 깨짐 / import 실패 →resetBuildState).plugin.ts커버리지 100%@typescript/nativetsc 통과Refs #686
🤖 Generated with Claude Code