H
Hono6mo ago
axorax

Hono is not working on netlify (Function crashed)

Hey! I'm totally new to hono. I tried to use hono for netlify but it's not working. here's all the code: netlify/edge-functions/index.ts
import { Hono } from 'jsr:@hono/hono'
import { handle } from 'jsr:@hono/hono/netlify'

const app = new Hono()

app.get('/', (c) => {
return c.text('Hello Hono!')
})

export default handle(app)
import { Hono } from 'jsr:@hono/hono'
import { handle } from 'jsr:@hono/hono/netlify'

const app = new Hono()

app.get('/', (c) => {
return c.text('Hello Hono!')
})

export default handle(app)
netlify.toml
[[edge_functions]]
function = "index"
path = "/*"
[[edge_functions]]
function = "index"
path = "/*"
The command I ran is netlify dev The error i get is:
Error - Could not find function 'index'

Error: Could not find function 'index'
at FunctionChain.getFunction (https://64523ab4e7865600087fc3df--edge.netlify.com/bootstrap/function_chain.ts:240:13)
at FunctionChain.runFunction (https://64523ab4e7865600087fc3df--edge.netlify.com/bootstrap/function_chain.ts:340:23)
at FunctionChain.run (https://64523ab4e7865600087fc3df--edge.netlify.com/bootstrap/function_chain.ts:310:31)
at handleRequest (https://64523ab4e7865600087fc3df--edge.netlify.com/bootstrap/handler.ts:80:34)
at Server. (https://64523ab4e7865600087fc3df--edge.netlify.com/bootstrap/server.ts:28:23)
at Server.#respond (https://deno.land/[email protected]/http/server.ts:299:37)
at Server.#serveHttp (https://deno.land/[email protected]/http/server.ts:346:20)
at eventLoopTick (ext:core/01_core.js:183:11)
Error - Could not find function 'index'

Error: Could not find function 'index'
at FunctionChain.getFunction (https://64523ab4e7865600087fc3df--edge.netlify.com/bootstrap/function_chain.ts:240:13)
at FunctionChain.runFunction (https://64523ab4e7865600087fc3df--edge.netlify.com/bootstrap/function_chain.ts:340:23)
at FunctionChain.run (https://64523ab4e7865600087fc3df--edge.netlify.com/bootstrap/function_chain.ts:310:31)
at handleRequest (https://64523ab4e7865600087fc3df--edge.netlify.com/bootstrap/handler.ts:80:34)
at Server. (https://64523ab4e7865600087fc3df--edge.netlify.com/bootstrap/server.ts:28:23)
at Server.#respond (https://deno.land/[email protected]/http/server.ts:299:37)
at Server.#serveHttp (https://deno.land/[email protected]/http/server.ts:346:20)
at eventLoopTick (ext:core/01_core.js:183:11)
No description
4 Replies
axorax
axoraxOP6mo ago
I updated my version of netlify-cli to the latest one and now if i run netlify dev i get
axorax
axoraxOP6mo ago
No description
axorax
axoraxOP6mo ago
i am in the correct folder. (the same folder where netlify.toml is situated)
Nico
Nico6mo ago
I am unsure here you may try restarting. I have no issues running
Want results from more Discord servers?
Add your server