Repository navigation
fix: mark the compiled server packages as ES modules - #5
Merged
Merged
Conversation
tish writes the compiled packages under .orbit/server/.../node_modules (@tishlang/orbit, tishdoc-*) without a package.json. Node never looks past a node_modules folder for one, so it takes them for CommonJS; Vercel's Node 22 runtime then failed every server route with "Named export 'Fragment' not found" (moo.moi's /callback and 404). compileEsm now writes {"type": "module"} into every package folder under any node_modules in the compiled tree.
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.
On Vercel, every server route of moo.moi's preview (
/callback, and the 404 page) failed with:tish writes the compiled packages under
.orbit/server/…/node_modules(@tishlang/orbit,tishdoc-*) with nopackage.json. Node never looks past anode_modulesfolder for one, so the files count as CommonJS. Plainnode(22 and 26) guesses ES modules from the syntax, which is why this didn't reproduce locally. Vercel's launcher doesn't guess.compileEsmnow writes{"type": "module"}into every package folder under anynode_modulesin the compiled tree. The end-to-end test checks that none are left unmarked.Checked locally:
npm run lintis clean.npm testpasses (25).npm run test:e2epasses, including the new check.