We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// api/app_const.ts export const AppConst = { key: "123", }
// api/index.ts import { Hono } from "hono" import { handle } from "@hono/node-server/vercel" import { AppConst } from "./app_const" const app = new Hono().basePath("/api") app.get("/", (c) => { return c.json({ message: AppConst.key }) }) export default handle(app)
already added "type": "module" in package.json
"type": "module"
package.json
When I vist http://localhost:3000/api
Error: Cannot find module '/Users/wp/development/hono-test/src/app_const' imported from /Users/wp/development/hono-test/api/index.ts
When I modify import { handle } from "import { AppConst } from "./app_const" to import { AppConst } from "./app_const.js" the error is gone.
import { handle } from "import { AppConst } from "./app_const"
import { AppConst } from "./app_const.js"
I wonder how can I import module without .js suffix.
.js
By the way: when I use edge runtime, did not have this issue.
edge
The text was updated successfully, but these errors were encountered:
Maybe duplicated to #84
Sorry, something went wrong.
No branches or pull requests
already added
"type": "module"
inpackage.json
When I vist http://localhost:3000/api
Error: Cannot find module '/Users/wp/development/hono-test/src/app_const' imported from /Users/wp/development/hono-test/api/index.ts
When I modify
import { handle } from "import { AppConst } from "./app_const"
toimport { AppConst } from "./app_const.js"
the error is gone.I wonder how can I import module without
.js
suffix.By the way: when I use
edge
runtime, did not have this issue.The text was updated successfully, but these errors were encountered: