Repository navigation
Conversation
A failed build stamps its entry and the files its diagnostics name. MO-6 names the importer, not the module that is missing or lacks the export, so restoring that module changed no stamp and the failed build was served until the entry or the importer was touched, or the dev server restarted (solidjs#84). Only a build that compiled is reused now; a program that does not compile is built again on each request. compiler/test/node.mjs: removes a dependency, sees MODULE_NOT_FOUND through the front end, puts the file back with its mtime unchanged, and compiles the entry and the dependency again, warm and cold. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This branch has not been deployed
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.
Fixes #84.
The Vite front end kept serving a failed build after the imported module that caused it was restored or fixed. #84 has the reproduction; it still reproduces on
mainat e650b85.Change
One condition in
build()(compiler/vite.mjs): a cached build is reused only if it compiled.A failed build stamps its entry and the files its diagnostics name.
MODULE_NOT_FOUNDandNOT_EXPORTED(MO-6) name the importer, not the module that is missing or lacks the export, so fixing that module changes no stamp. A failed build can't tell when it has gone stale, so it is built again on the next request.A program that compiles is cached as before: five compiles of an unchanged
examples/shop(the entry, its three dependencies, the entry again) make one native build.Test
compiler/test/node.mjsgets one case, so it runs in thecompilerworkflow on each platform. Through the front end it removes a dependency, seesMODULE_NOT_FOUNDat the importer, renames the file back (its mtime unchanged), and compiles the entry and the dependency again. It then does the same with a front end whose first compile was the failing one and whose next request is the dependency (containing()'s cold path). Withmain'svite.mjsthe case fails on the staleMODULE_NOT_FOUND.I put it there and not in
test/vite.mjsbecause no workflow runs that file, and the case needs onlyrx().compile(). Say if you'd rather have it intest/vite.mjs.Verified
On macOS arm64, Node 26.13.1, rustc 1.98.1 (CI pins 1.99.1), Solid at the pinned 30e7805eb:
ref:npm testexits 0 with no failing check;npm run oracleandnpm run compiled135 pass;npm run ssr128 pass, 7 skip;npm run types181 pass. No scenario's result changed.compiler:npm test7 pass;cargo testpasses;test/vite.mjs16 pass against solid-vite-plugin 3.0.1 (cbc6ce2).runtime:npm testpasses.NOT_EXPORTEDfixed with the mtime kept, the first compile made while the module is unreadable (chmod 000), and a dependency requested after its program failed. Onmainall five keep the error.The
compilerworkflow, run on my fork at this commit, is green on all six builds, and the new case passes on Linux x64 and arm64, macOS arm64, Windows x64 and WASI: https://github.com/cgaaf/reactivescript/actions/runs/45316052946Cost
While a program does not compile, each request for it builds it again. On
examples/shop(4 modules), per request:main(cached failure)catalog.rxmissingcatalog.rxmissingNOT_EXPORTEDfrom the checkerNOT_EXPORTEDfrom the checkerA dependency request costs more because
containing()walks the project for a program that holds it, as it does onmain.mainhas no figure forNOT_EXPORTEDbecause it was still serving the earlier failure.Alternatives
builds. A dependency request would then go straight to its program and skip the walk. But I tried it: with two programs sharing a module, one of them broken and the shared module then edited,containing()picks the broken program's old build and reports its diagnostics for a module the other program still compiles. With this branch the same request compiles. Fixing that means havingcontaining()try each candidate, which is more than Vite front end keeps serving a failed build after the missing/broken imported module is fixed #84 needs.Not addressed
A build that compiled is still judged by the mtimes of its emitted modules alone. A module made unreadable (
chmod 000) after a good build keeps being served, sincechmoddoesn't change the mtime. That is separate from #84 and unchanged here.No version is bumped and
CHANGELOG.mdis untouched.🤖 Generated with Claude Code