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
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
netlify.toml
[[edge_functions]] function = "index" path = "/*"
[[edge_functions]] function = "index" path = "/*"
The command I ran is
netlify dev
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/std@0.170.0/http/server.ts:299:37) at Server.#serveHttp (https://deno.land/std@0.170.0/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/std@0.170.0/http/server.ts:299:37) at Server.#serveHttp (https://deno.land/std@0.170.0/http/server.ts:346:20) at eventLoopTick (ext:core/01_core.js:183:11)