Comments (9)
AH, sorry! I only use vercel dev
, but when I use vercel
command to deploy, it fails.
from middleware.
We cannot know with that much information. Please share the minimal code or project to reproduce.
from middleware.
app.ts
import { swaggerUI } from '@hono/swagger-ui'
import { OpenAPIHono} from '@hono/zod-openapi'
import { Hono } from 'hono'
const app = new OpenAPIHono()
//const app = new Hono()
app.get("/balance", async (c) => {
return c.json([])
})
app.get('/', swaggerUI({ url: '/doc'}))
export default app
api/index.ts
import { handle } from 'hono/vercel'
import app from '../app.js'
export const config = {
runtime: 'edge'
}
export default handle(app)
vercel.json
{
"rewrites": [
{
"source": "/(.*)",
"destination": "/api"
}
]
}
after trying to deploy with vercel command(CLI) its gives me
Error: The Edge Function "api/index" is referencing unsupported modules:
- @HONO: hono/utils/url
It works with Hono instance or if I disable Edge
from middleware.
Thanks. But, I can't reproduce the problem. The following project works well!
https://github.com/yusukebe/vercel-zod-openapi
from middleware.
@yusukebe hmm weird, i just cloned and typed "vercel"
did you use "vercel" instead of "vercel dev" ?
What else can I do to debug it?
I am on vercel hobby if it matters
from middleware.
This is certainly an error I've never seen before and don't know how to resolve. Hmm
from middleware.
I am also getting the same issue here, along with the hono/jsx/jsx-runtime
module.
I think the issue here is that Edge Functions (along with some other bundlers/runtimes) seem to struggle with resolving package.json#exports
(at least nested modules – ie. hono/x/y
).
A possible solution could be to create proxy packages (a package.json
in a subdirectory that have resolvers to the dist files). Here is an example.
from middleware.
Hello @draew6, Did you fix the problem with @jxom 's solution? Can you share your fix ?
from middleware.
@jxom @kevinbalicot sorry, i am new to this. How would that look like in my example please?
from middleware.
Related Issues (20)
- hono/zod-openapi route groups don't populate into doc endpoint HOT 4
- @hono/sentry ESM support HOT 4
- Zod-OpenAPI no longer works with Hono 4.3.0 HOT 7
- [valibot-validator] Type inference failure in RPC routes when `"query"` contains `number` type(s). HOT 1
- Access user object returned by middleware HOT 2
- [zod-openapi] Hook type error with async function
- [zod/open-api] Problem with RPC types HOT 2
- [valibot-validator] Supports async validation HOT 1
- [zod-openapi] RPC Mode Fails Without Request Parameters HOT 2
- [zod-openapi] Unable to use async handler HOT 1
- [zod-openapi] RPC mode fails if handler is not in the router file HOT 4
- [zod-openapi]- running middleware after validation HOT 3
- [zod-openapi] MaybePromise response type issue HOT 4
- [zod-openapi] wrong path in hono/client ?
- hono/cors does not work in the route definition.
- [zod-openapi] Make range definitions available
- [auth-js] How to trigger actual sign-in
- behind a reverse proxy, X-Forwarded-Proto isn't used and plain http is used for the signin action HOT 7
- Grouped Route Path Parameters Not Recognized in @hono/zod-openapi
- hono-openapi expects `method` parameter to be of a specific type HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from middleware.