Skip to content

feat: import map from deno's importMap field - #3429

Closed
kallebysantos wants to merge 4 commits into
supabase:developfrom
kallebysantos:feat-import-map-from-deno-config
Closed

feat: import map from deno's importMap field#3429
kallebysantos wants to merge 4 commits into
supabase:developfrom
kallebysantos:feat-import-map-from-deno-config

Conversation

@kallebysantos

Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

feature / fix

What is the current behavior?

Current is not possible to use the deno'simportMap to specify the target import map.

Error
worker boot error: failed to create the graph: Relative import path "@mylib" not prefixed with / or ./ or ../ and not in import map from "file:///Users/kallebysantos/projects/community/supabase/supabase-cli/supabase/testing.imports/supabase/functions/hello/index.ts"
at file:///Users/kallebysantos/projects/community/supabase/supabase-cli/supabase/testing.imports/supabase/functions/hello/index.ts:3:21
worker boot error: failed to create the graph: Relative import path "@mylib" not prefixed with / or ./ or ../ and not in import map from "file:///Users/kallebysantos/projects/community/supabase/supabase-cli/supabase/testing.imports/supabase/functions/hello/index.ts"
at file:///Users/kallebysantos/projects/community/supabase/supabase-cli/supabase/testing.imports/supabase/functions/hello/index.ts:3:21
InvalidWorkerCreation: worker boot error: failed to create the graph: Relative import path "@mylib" not prefixed with / or ./ or ../ and not in import map from "file:///Users/kallebysantos/projects/community/supabase/supabase-cli/supabase/testing.imports/supabase/functions/hello/index.ts"
at file:///Users/kallebysantos/projects/community/supabase/supabase-cli/supabase/testing.imports/supabase/functions/hello/index.ts:3:21
at async UserWorker.create (ext:sb_user_workers/user_workers.js:139:15)
at async Object.handler (file:///root/index.ts:157:22)
at async respond (ext:sb_core_main_js/js/http.js:197:14) {
name: "InvalidWorkerCreation"
}

Source code

What is the new behavior?

This PR add support to load import_map path directly from deno.json(c) file.

# Folder structure
supabase/functions/
├── hello
│ ├── deno.json
│ └── index.ts
└── import_map.json
// deno.json file
{
"importMap": "../import_map.json"
}

- It allows to use the `importMap` field to pass the `import_map.json`
path directly from `deno.json`
@kallebysantos
kallebysantos requested a review from a team as a code ownerApril 13, 2025 12:20
@coveralls

coveralls commented Apr 13, 2025

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 14429477949

Details

  • 18 of 18(100.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.05%) to 51.004%

Files with Coverage ReductionNew Missed Lines%
internal/storage/rm/rm.go289.53%
TotalsCoverage Status
Change from base Build 14417761518:0.05%
Covered Lines:6987
Relevant Lines:13699

💛 - Coveralls

Comment threadpkg/config/config.go
@kallebysantos
kallebysantos deleted the feat-import-map-from-deno-config branch January 14, 2026 10:43
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.

3 participants

@kallebysantos@coveralls@sweatybridge