docs: use correct relative imports in code examples#850
Open
SAY-5 wants to merge 1 commit intohonojs:mainfrom
Open
docs: use correct relative imports in code examples#850SAY-5 wants to merge 1 commit intohonojs:mainfrom
SAY-5 wants to merge 1 commit intohonojs:mainfrom
Conversation
Per honojs#579, docs/ examples used relative imports without file extensions and imported types without the `type` keyword, which fails on a fresh Hono app that uses NodeNext module resolution and verbatimModuleSyntax. Add the `.js` extension to all extensionless relative imports (`./foo` → `./foo.js`) and convert two value-position `AppType` imports in docs/concepts/stacks.md to `import type`. Closes honojs#579
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.
Per #579, docs/ code examples use relative imports without file extensions and import types without the
typekeyword, which fails on a fresh Hono app whose defaulttsconfig.jsonuses NodeNext module resolution andverbatimModuleSyntax.Two classes of fixes:
Extensionless relative imports get
.jsadded (./foo→./foo.js). Without this, NodeNext throws:Value-position
AppTypeimports indocs/concepts/stacks.mdare converted toimport type. Without this,verbatimModuleSyntaxthrows:The two
'../functions/api/[[route]]'imports are intentionally left as-is — those are Cloudflare Pages route patterns, not real file paths.Closes #579