Skip to content
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

Unresolved Import Maps Paths #1269

Open
marklundin opened this issue Feb 26, 2025 · 0 comments
Open

Unresolved Import Maps Paths #1269

marklundin opened this issue Feb 26, 2025 · 0 comments

Comments

@marklundin
Copy link
Member

marklundin commented Feb 26, 2025

When adding import maps to an ESM project, the code editor fails to resolve modules, both for local and external modules.

So for the following valid import map

{
  "imports": {
    "react": "https://esm.sh/react",
    "@math" : "./tools/utils/math.mjs",
    "@utils/" : "./tools/utils/"
  }
}

The paths are not resolved in the code editor

import * as pc from 'playcanvas' // ✅ This is fine
import react from 'react'' // ❌ Undefined path
import { mul } from '@utils/math.mjs' // ❌ Undefined path
import { mul as mul2 } from '@math' // ❌ Undefined path

In monaco this looks like, meaning you lose intellisense.

Image

We need to add aliases to local paths and mark external modules as so, or alternatively perform some automated type acquisition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant