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
All examples in the documentation have relative imports without a file extension.
However freshly initialized app uses "module": "NodeNext" in tsconfig.json which requires these imports to have an extension.
If you try to use a relative import without an extension you get this error:
Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'.
I think it should be fixed, to show correct examples that won't need to be fixed after copying by the user.
Imports without a type keyword
There are also some examples that import types without the type keyboard.
For example import { AppType } from './server' in the "Hono Stacks" page should've been import type { AppType } from './server', otherwise it will throw this error:
'AppType' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.
Again, this is using the default configuration of the initialized app, so these examples should adhere to that configuration.
I'm new to Hono, and I just want to say that I really like it so far, and appreciate all the work you guys have put into it. I believe that the documentation is the most important part of any framework, so making sure that it is nicely categorized, has lots of examples and correct code is extremely helpful to every newcomer.
The text was updated successfully, but these errors were encountered:
Imports without an extension
All examples in the documentation have relative imports without a file extension.
However freshly initialized app uses
"module": "NodeNext"
intsconfig.json
which requires these imports to have an extension.If you try to use a relative import without an extension you get this error:
I think it should be fixed, to show correct examples that won't need to be fixed after copying by the user.
Imports without a type keyword
There are also some examples that import types without the
type
keyboard.For example
import { AppType } from './server'
in the "Hono Stacks" page should've beenimport type { AppType } from './server'
, otherwise it will throw this error:Again, this is using the default configuration of the initialized app, so these examples should adhere to that configuration.
I'm new to Hono, and I just want to say that I really like it so far, and appreciate all the work you guys have put into it. I believe that the documentation is the most important part of any framework, so making sure that it is nicely categorized, has lots of examples and correct code is extremely helpful to every newcomer.
The text was updated successfully, but these errors were encountered: