Skip to content

Conversation

@7ttp
Copy link
Contributor

@7ttp 7ttp commented Dec 7, 2025

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 owner December 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.

closes supabase#4424
@7ttp 7ttp changed the base branch from main to develop December 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
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
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.

@7ttp 7ttp requested a review from sweatybridge December 15, 2025 11:34
@woodside-david-francoeur

Thanks, for that, it works for me

@7ttp 7ttp changed the title fix(functions): resolve deno lint errors in generated edge function template Fix: Remove inline jsr: import from generated functions template Jan 27, 2026
@IdellHeaney
Copy link

+1 thanks @sweatybridge @7ttp

@sweatybridge sweatybridge changed the title Fix: Remove inline jsr: import from generated functions template fix: remove inline jsr: import from generated functions template Jan 30, 2026
@coveralls
Copy link

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 Reduction New Missed Lines %
internal/debug/postgres.go 3 66.09%
internal/gen/keys/keys.go 5 12.9%
Totals Coverage Status
Change from base Build 21508511524: -0.05%
Covered Lines: 7107
Relevant Lines: 12820

💛 - Coveralls

@sweatybridge sweatybridge merged commit 80b3444 into supabase:develop Jan 30, 2026
10 of 12 checks passed
@7ttp 7ttp deleted the bug-76 branch January 30, 2026 10:58
Sign up for free to 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