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

fix(astro): Convert init file paths to POSIX paths #9336

Merged
merged 2 commits into from
Oct 23, 2023

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Oct 23, 2023

To inject a custom client/server Sentry.init call into the user bundles, we simply import from the file.
However, it seems like Vite can't resolve an absolute windows path in an import statement:

import 'C:\path\to\my\sentry.client.config.ts'

This PR converts non-posix paths to a POSIX conforming path first which should fix this limitation. This bug was reported on Discord and I asked to user to test the fix in their local setup which they confirmed to be working.

Note: Omitted tests here because it's quite hard to get path.sep to return the actual windows \\ separator instead of the OS one. Can revisit if reviewers prefer to have this properly covered.

@Lms24 Lms24 changed the title Lms/fix astro paths on windows fix(astro): Convert init file paths to POSIX paths Oct 23, 2023
@Lms24 Lms24 merged commit 8e603b5 into develop Oct 23, 2023
47 checks passed
@Lms24 Lms24 deleted the lms/fix-astro-paths-on-windows branch October 23, 2023 15:16
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.

3 participants