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

Strip query parameter in File import #16480

Merged
merged 2 commits into from
Jan 18, 2025
Merged

Conversation

pfgithub
Copy link
Contributor

What does this PR do?

Fixes #16476

Something I noticed: query parameters don't work at all in bun build

import text from "./b.txt?1";
import file from "./c.file?2";

console.log(text, file);
$> bun build --target=browser a.ts
1 | import text from "./b.txt?1";
                     ^
error: Could not resolve: "./b.txt?1"
    at a.ts:1:18

2 | import file from "./c.file?2";
                     ^
error: Could not resolve: "./c.file?2"
    at a.ts:2:18
Exited with code [1]

They should probably work and with --target=browser maybe even preserve the query parameter (but not for bun/node)

@robobun
Copy link

robobun commented Jan 17, 2025

Updated 11:50 AM PT - Jan 18th, 2025

@Jarred-Sumner, your commit 5807d34 has passed in #10046! 🎉


🧪   try this PR locally:

bunx bun-pr 16480

@Jarred-Sumner
Copy link
Collaborator

oh this is silly

we should just create the JSString

@Jarred-Sumner Jarred-Sumner merged commit e46e922 into main Jan 18, 2025
69 checks passed
@Jarred-Sumner Jarred-Sumner deleted the pfg/fix-file-query-import branch January 18, 2025 20:40
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.

Regression: release 1.1.45 broke ?url imports
3 participants