Skip to content

fix: Match modules whose id has a query - #53

Merged
isaacs merged 1 commit into
apm-js-collab:mainfrom
JPeer264:jp/strip-query-module-id
Oct 28, 2026
Merged

isaacs merged 1 commit into
apm-js-collab:mainfrom
JPeer264:jp/strip-query-module-id

Conversation

@JPeer264

Copy link
Copy Markdown
Contributor

closes #52

Description

This removes the query and the hash from the module id before the module is matched. A dependency that Vite's dev server loads as <file>?v=<hash> is now transformed. transform() already used the stripped path for sourceFile.

Vite's dev server loads a dependency that it does not pre-bundle as
`<file>?v=<hash>`. The raw id went to `moduleDetailsFromPath()` and
`detectModuleType()`, so the path did not match the configured
`filePath`, and the module was not transformed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JPeer264
JPeer264 marked this pull request as ready for review October 27, 2026 19:06

@isaacs isaacs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@isaacs

isaacs commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Would be good to get a non-Sentry pair of eyes on this, if possible. 🙏

@isaacs

isaacs commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Close enough ;)

@isaacs
isaacs merged commit 4dbf34b into apm-js-collab:main Oct 28, 2026
1 check passed
@timfish timfish mentioned this pull request Oct 28, 2026
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.

Vite plugin does not transform modules whose id has a query (?v=<hash> in vite dev)

4 participants