Skip to content

fix: remove inline jsr: import from generated functions template - #4591

Merged
sweatybridge merged 2 commits into
supabase:developfrom
7ttp:bug-76
Jan 30, 2026
Merged

fix: remove inline jsr: import from generated functions template#4591
sweatybridge merged 2 commits into
supabase:developfrom
7ttp:bug-76

Conversation

@7ttp

@7ttp7ttp commented Dec 7, 2025

Copy link
Copy Markdown
Member

Summary

The template generated by supabase functions new produces code that triggers Deno lint errors due to an inline jsr: import without a version specifier.

Problem

The generated template includes:

import"jsr:@supabase/functions-js/edge-runtime.d.ts";

This violates two default Deno lint rules:

  • no-import-prefix – inline jsr: dependencies are not allowed
  • no-unversioned-import – missing version in specifier

Related

@7ttp
7ttp requested a review from a team as a code ownerDecember 7, 2025 14:41
…emplate
the template generated by 'supabase functions new' produces deno lint errors
on line 6 due to inline jsr: import without version specifier:
import jsr:@supabase/functions-js/edge-runtime.d.ts
this triggers two default deno lint rules:
- no-import-prefix: inline jsr: dependency not allowed
- no-unversioned-import: missing version in specifier
fix moves the dependency declaration to deno.json with proper versioning
and updates index.ts to use bare specifier import as recommended by deno.
closessupabase#4424
@7ttp
7ttp changed the base branch from main to developDecember 7, 2025 14:57
// This enables autocomplete, go to definition, etc.

// Setup type definitions for built-in Supabase Runtime APIs
import "jsr:@supabase/functions-js/edge-runtime.d.ts"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nyannyacha is this a problem we need to address?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mentioned lints appear to have been introduced in Deno v2.5.
Since we're currently fixed at Deno 2.1.4, not fixing the lints wouldn't cause much impact. However, the problem is that we can't prevent users from using the latest version of Deno.

So in my opinion... yes, I agree to change the template style so the lints don't complain.

@woodside-david-francoeur

Copy link
Copy Markdown

Thanks, for that, it works for me

@7ttp7ttp changed the title fix(functions): resolve deno lint errors in generated edge function templateFix: Remove inline jsr: import from generated functions templateJan 27, 2026
@IdellHeaney

Copy link
Copy Markdown

+1 thanks @sweatybridge@7ttp

@sweatybridgesweatybridge changed the title Fix: Remove inline jsr: import from generated functions templatefix: remove inline jsr: import from generated functions templateJan 30, 2026
@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 21512140722

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 8 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.05%) to 55.437%

Files with Coverage ReductionNew Missed Lines%
internal/debug/postgres.go366.09%
internal/gen/keys/keys.go512.9%
TotalsCoverage Status
Change from base Build 21508511524:-0.05%
Covered Lines:7107
Relevant Lines:12820

💛 - Coveralls

@sweatybridge
sweatybridge merged commit 80b3444 into supabase:developJan 30, 2026
10 of 12 checks passed
@7ttp
7ttp deleted the bug-76 branch January 30, 2026 10:58
@supabase-cli-releasersupabase-cli-releaserBot mentioned this pull request Feb 3, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Supabase Edge Functions Linting Issue - supabase functions new generates code with Deno IDE and linting errors

6 participants

@7ttp@woodside-david-francoeur@IdellHeaney@coveralls@sweatybridge@nyannyacha