Closed evelant closed 1 year ago
This is blocking my local development at the moment. Going to try rolling back to an older version of supabase cli.
Unfortunately rolling back doesn't appear to work. Earlier versions of the edge runtime are missing globals which should always be present on Deno. worker thread panicked ReferenceError: performance is not defined
edit: I was able to work around the missing performance
global bug and get things running on cli v1.47.0
I think this issue is possibly a combination of a few bugs:
hyper::Error(User(Service), operation was canceled: connection was not ready
hyper::Error(IncompleteMessage)
Unfortunately now I can't deploy my edge functions. I used dynamic import to allow me to put a shim in for the missing performance global. I wasn't aware that dynamic import works fine locally but when deployed crashes with Dynamic import is not enabled in this context.
I am experiencing this issue as well. Any timeline for a fix or workaround?
v1.49.4 is the last usable edge-runtime I've been able to locally develop & deploy my edge functions to prod.
See: https://github.com/langchain-ai/langchain-template-supabase/issues/1
Can confirm. Downgrading to supabase 1.49.4 fixed the issue for me.
I removed the cli with homebrew and then reinstalled from this .rb file:
https://github.com/supabase/homebrew-tap/blob/6704504cea91f643eba30546befa715af5701c75/supabase.rb
@laktek have you been able to reproduce this? It's still not possible to use supabase cli versions > 1.49.4 due to this. Seems related to https://github.com/supabase/edge-runtime/issues/59 https://github.com/supabase/edge-runtime/issues/58
@evelant sorry for the late response. I was doing other refactors and was meant to address this issue this week. Will provide a solution within the next 3 days.
@evelant Can you share the import map of your project? I'm trying to reproduce the issue.
{
"imports": {
"@effect/data/": "https://esm.sh/@effect/data@0.12.2&target=deno/",
"@effect/io/": "https://esm.sh/@effect/io@0.25.7&target=deno/",
"@effect/stream/": "https://esm.sh/@effect/stream@0.21.0&target=deno/",
"@effect/match/": "https://esm.sh/@effect/match@0.17.0&target=deno/",
"@effect/schema/": "https://esm.sh/@effect/schema@0.17.2&target=deno/",
"@react-native-async-storage/async-storage": "https://esm.sh/@react-native-async-storage/async-storage@1.18.1?target=deno",
"@supabase/postgrest-js": "https://esm.sh/@supabase/postgrest-js@1.5.0?target=deno",
"http": "https://esm.sh/@types/node@18.11.13/http.d.ts?target=deno&no-check",
"@supabase/postgrest-js/": "https://esm.sh/@supabase/postgrest-js@1.5.0&target=deno/",
"@supabase/supabase-js": "https://esm.sh/@supabase/supabase-js@2.21.0?target=deno",
"@supabase/supabase-js/": "https://esm.sh/@supabase/supabase-js@2.21.0&target=deno/",
"axios": "https://esm.sh/axios@1.3.5?target=deno",
"date-fns": "https://esm.sh/date-fns@v2.29.3?target=deno&no-check",
"date-fns/": "https://esm.sh/date-fns@v2.29.3&target=deno&no-check/",
"deep-object-diff": "https://esm.sh/deep-object-diff@1.1.9?target=deno",
"deep-object-diff/": "https://esm.sh/deep-object-diff@1.1.9&target=deno/",
"lodash": "https://esm.sh/lodash-es@4.17.21?target=deno",
"mobx": "https://esm.sh/mobx@6.9.0/dist/mobx.esm.js?target=deno",
"mobx/": "https://esm.sh/mobx@6.9.0/dist/mobx.esm.js&target=deno/",
"mobx-keystone": "https://esm.sh/mobx-keystone@1.4.1?target=deno",
"mobx-keystone/": "https://esm.sh/mobx-keystone@1.4.1&target=deno/",
"mobx-utils": "https://esm.sh/mobx-utils@6.0.5?target=deno",
"mobx-utils/": "https://esm.sh/mobx-utils@6.0.5&target=deno/",
"postgresjs/": "https://deno.land/x/postgresjs@v3.3.4/mod.js/",
"postgresjs": "https://deno.land/x/postgresjs@v3.3.4/mod.js",
"react-native-mmkv": "https://esm.sh/react-native-mmkv@2.8.0?target=deno&bundle",
"react-native-mmkv/": "https://esm.sh/react-native-mmkv@2.8.0&target=deno&bundle/",
"rxjs": "https://esm.sh/rxjs@7.5.6?target=deno",
"rxjs/": "https://esm.sh/rxjs@7.5.6&target=deno/",
"safe-stable-stringify": "https://esm.sh/safe-stable-stringify@2.4.3?target=deno",
"safe-stable-stringify/": "https://esm.sh/safe-stable-stringify@2.4.3&target=deno/",
"seedrandom": "https://esm.sh/seedrandom@3.0.5?target=deno",
"seedrandom/": "https://esm.sh/seedrandom@3.0.5&target=deno/",
"serialize-error": "https://esm.sh/serialize-error@8.1.0?target=deno",
"serialize-error/": "https://esm.sh/serialize-error@8.1.0&target=deno/",
//// removed 3 entries that pointed to a private github repo here, authorized with DENO_AUTH_TOKENS
"ts-pattern": "https://esm.sh/ts-pattern@4.1.3?target=deno",
"ts-pattern/": "https://esm.sh/ts-pattern@4.1.3&target=deno/",
"unique-names-generator": "https://esm.sh/unique-names-generator@4.7.1?target=deno",
"unique-names-generator/": "https://esm.sh/unique-names-generator@4.7.1&target=deno/"
}
}
@laktek any luck in reproducing this?
@evelant yep, was able to reproduce it. There are several issues need fixing, hoping to resolve them this week. (btw, can you verify the import_map.json is a valid JSON file without any invalid characters? currently, we don't show an error for this)
Yes it's valid JSON, the same import map works fine on edge-runtime 1.1.7
I have the same error when cloning the repo and running the examples. (No code change)
main function started
serving the request with ./examples/hello-world
server started modified
serving the request with ./examples/hello-world
serving the request with ./examples/hello-world
hyper::Error(User(Service), connection closed before message completed)
Error in main worker connection: connection closed before message completed
hyper::Error(User(Service), operation was canceled: connection was not ready
Caused by:
connection was not ready)
When the workerTimeoutMs
after the first served request is reached every other request has this problem.
The first request after the timeout will return
Error in main worker connection: connection closed before message completed
Every other request will return
Error in main worker connection: connection closed before message completed
hyper::Error(User(Service), operation was canceled: connection was not ready
Caused by:
connection was not ready)
Lowering workerTimeoutMs
in main/index.ts to 1000 helps experiencing the error sooner.
OS: Ventura, Mac M1 edge-runtime: v1.2.18
I build code using scripts/run.sh.
@laktek Any luck with fixes here? I'm still stuck on v1.49.4 of the cli due to this.
@evelant Sorry, still working on this. Turned out the issue's scope was a bit more complex (beyond import maps) than I originally assessed. I'll update soon as I have a complete fix.
@evelant Can you try upgrading to latest CLI (1.61.1+) and see if you still experience this issue?
Also, now you should be able to use performance
global object without doing any polyfills.
Closing this one - I think with the recent fixes this should be fully handled. Please upgrade to latest CLI to get the changes.
Bug report
Describe the bug
In the most recent version of supabase cli when developing edge functions the server times out while caching Deno deps then becomes unresponsive.
To Reproduce
hyper::Error(IncompleteMessage)
Subsequent edge function calls fail immediately with
Expected behavior
The deps should be cached on first run resulting in one slow start then subsequent quick starts.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
Additional context
Full log of what happens when I first send a request to the newest version of edge runtime