Skip to content

Workspace level importMap breaks member import entry resolution #28110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Yohe-Am opened this issue Feb 14, 2025 · 1 comment · Fixed by #28116
Closed

Workspace level importMap breaks member import entry resolution #28110

Yohe-Am opened this issue Feb 14, 2025 · 1 comment · Fixed by #28116

Comments

@Yohe-Am
Copy link

Yohe-Am commented Feb 14, 2025

What it says on the tin, the entries on the workspace member import map don't work if there's an importMap entry on the workspace root config. The error displayed is the good old:

error: Relative import path "@two/mod.ts" not prefixed with / or ./ or ../ and not in import map from "file:///tmp/repro/one/mod.ts"
    at file:///tmp/repro/one/mod.ts:1:23

This breaks the behavior described by the docs.

Exclusive with imports and scopes per config file. It is allowed to have importMap in the workspace config, and imports in the package config.

Unless I'm reading them anyways. This only happens from the 0.2.5 onwards.

Reproduction avail here.

@dsherret
Copy link
Member

dsherret commented Feb 14, 2025

This is by design. It's a scenario we don't support because we found it's too hard to reason exactly how this should work in every scenario. You need to move the import map into the deno.json or put everything in the import map. We should be displaying a warning in this scenario though.

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 a pull request may close this issue.

2 participants