Skip to content

Conversation

@7ttp
Copy link
Contributor

@7ttp 7ttp commented Dec 7, 2025

Fix: Remove inline jsr: import from generated functions template

The template created by supabase functions new currently triggers Deno lint errors because it includes an inline jsr: import without a version:

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

Changes in this PR

  • Moves the @supabase/functions-js type dependency into deno.json with a pinned version
  • Updates index.ts to use a bare specifier import, following Deno’s recommended pattern

These updates resolve the lint errors and ensure the generated functions template adheres to Deno best practices.

Closes #4424

@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.

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

3 participants