Closed alita-moore closed 2 months ago
my current work around is to manually edit the deno lock file, which is obviously not a great solution. I have tried to downgrade deno, but brew makes that quite difficult, so manually editing the deno lock file seems to be the easiest solution here.
I believe just the https://crates.io/crates/deno_lockfile version needs to be bumped in the supabase codebase if this issue still occurs. I'm not sure how things are setup under the hood though.
@alita-moore Can you share the Supabase CLI version you're using? Also, try with latest version of Supabase CLI (npx supabase@latest functions deploy
) and see if you experience the same issue.
@alita-moore Can you share the Supabase CLI version you're using? Also, try with latest version of Supabase CLI (
npx supabase@latest functions deploy
) and see if you experience the same issue.
Here is the output with lock file v3
❯ npx supabase@latest functions deploy
Need to install the following packages:
supabase@1.106.1
Ok to proceed? (y) y
error: Unable to parse contents of the lockfile "/Users/surya/Projects/founderblocks/auto.deals/deno.lock"
Caused by:
invalid type: map, expected a string
exit status 1
Try rerunning the command with --debug to troubleshoot the error.
updated to the latest version and this is fixed, thanks!
nevermind it looks like it's not actually fixed, was only fixed for a short time:
Caused by: invalid type: map, expected a string exit status 1 Try rerunning the command with --debug to troubleshoot the error.
@laktek I'm using version 1.106.1
this is a blocking problem. Is this only affecting me?
no, I'm having the same problem. CLI version 1.106.1, deno 1.37.2
in that case, a bad
workaround for this is to manually download teh deno binary from their release page and then run deno cache ...
with it to have it then generate the version 2 lockfile which supabase can use.
https://github.com/denoland/deno/releases/tag/v1.36.4
in that case, a
bad
workaround for this is to manually download teh deno binary from their release page and then rundeno cache ...
with it to have it then generate the version 2 lockfile which supabase can use. https://github.com/denoland/deno/releases/tag/v1.36.4
This didn't work for me. I got the same error about "Unable to parse contents..."
CLI version 1.110.1, Deno 1.37.2
it also worked for me to just delete deno.lock altogether and run supabase after that
bump, this is still broken
@alita-moore Can you try running the Beta version of CLI (npx supabase@beta functions serve
)? You probably don't need to manually do deno cache
and also can remove the existing deno lock file.
I need to do deno cache because of how my IDE works. Sure, I'll try it next time I deploy
yeah, try the newer version of CLI and let us know how it goes. Technically, it shouldn't look into your deno cache
.
npx supabase@beta functions deploy
no longer errors with deno.lock version 3 for me
@alita-moore Can you also try the beta release and confirm if it works?
yeah @laktek that fixes the issue with the lock file. However, it seems that now it fails to load files that are not in the functions directory. I need to load in files from outside the directory because that's the only way I've found to share files between supabase projects. i.e.
| file.ts | project -- | supabase ---- | functions ------ | function.ts
When function imports file.ts it works in the current supabase but fails in the beta. I'm not sure there's a better way to create a shared library in deno.
When function imports file.ts it works in the current supabase but fails in the beta.
The import issue is caused by the same underlying problem and is resolved in the beta release 1.123.4. Appreciate your patience in helping to debug these issues.
Experiencing this after running npm upgrade.
macOS, deno 1.39.1 (release, aarch64-apple-darwin) v8 12.0.267.8 typescript 5.3.3
@codingiswhyicry Can you share which version of the Supabase CLI you're on?
Yep :-) CLI 1.115.5
I can confirm this is fixed in the altest versions, but the issue I referenced above with the file imports is not fixed :( https://github.com/supabase/cli/issues/2533
@alita-moore for files outside supabase/functions
directory, you can import them by declaring in supabase/functions/import_map.json
. For eg.
{
imports: {
"my-module": "../../file.ts"
}
}
The same import map can also be used for deno lsp support in your local IDE. More examples here https://docs.deno.com/runtime/manual/basics/import_maps/
Bug report
Describe the bug
When I try and deploy a function I get the following error
To Reproduce
It's difficult to produce this because I don't have multiple computers to try it on. But it seems to be:
supabase functions deploy
Expected behavior
I expect my functions to deploy
System information
Additional context
Here are the lock files before and after the version 3.0 upgrade:
before
after
I have validated that by reverting the lock file the issue is resolved.