Skip to content

Shim import.meta.url for ESM dependencies - #366

Merged
davidjgoss merged 1 commit into
mainfrom
import-meta-url
Nov 5, 2026
Merged

davidjgoss merged 1 commit into
mainfrom
import-meta-url

Conversation

@davidjgoss

@davidjgoss davidjgoss commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

🤔 What's changed?

esbuild now injects a stand-in for import.meta.url, pointing at the bundled out/extension.js, where the wasm files are copied.

⚡️ What's your motivation?

language-service main uses web-tree-sitter 0.27, which is ESM-only and finds web-tree-sitter.wasm via import.meta.url. Bundled as CommonJS, that is undefined, so the server fails to initialise:

Request initialize failed with message: The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received undefined

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

📋 Checklist:

@davidjgoss
davidjgoss marked this pull request as ready for review November 5, 2026 16:33
@davidjgoss
davidjgoss merged commit c1c73f9 into main Nov 5, 2026
8 checks passed
@davidjgoss
davidjgoss deleted the import-meta-url branch November 5, 2026 16:34
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.

1 participant