-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
--compile
TypeError: Argument must be a file URL on a new Sveltekit
#5178
Comments
The bug still reproduces... command bun build . --compile --outfile out error when running 2060 | // node_modules/clipboardy/lib/linux.js
2061 | var import_execa2 = __toESM(require_execa(), 1);
2062 | import path from "path";
2063 | import {fileURLToPath} from "url";
2064 |
2065 | var __dirname2 = path.dirname(fileURLToPath(import.meta.url));
^
TypeError: Argument must be a file URL
at compiled://root/auth:2065:30
at processTicksAndRejections (:1:2602) and the original source code const profilePath = `${import.meta.dir}/profiles/${stage}.json`;
const profileFile = Bun.file(profilePath); |
Oh interesting that makes sense We need to make fileURL allow compiled:// and pretend it’s the same as file:// |
It’d be a killer feature if compiled binaries work like butter. All in all, bun is really performant for http requests, I didn’t expect that. |
Hi @Jarred-Sumner |
Still reproducable in 1.06 |
I agree, it would be a killer feature if this would "just work". |
Update: Occurs still on bun |
Oh I see why this is happening. |
Waiting eagerly! Thanks @Jarred-Sumner |
@kevincobain2000 Not just you, I'm waiting as well |
This will ship in Bun v1.0.22. If you run |
Thanks.
Reproduce steps Create new SvelteKit app npm create svelte@latest my-app
cd my-app
bun install
bun add svelte-adapter-bun
# update adapter to: import adapter from 'svelte-adapter-bun'
vi svelte.config.js
bun run build
bun build build/index.js --compile --outfile binary
./binary Error 1) from brand new sveltekit project
Extra Info below: Error 2) From a different project. It is unable to find the assets
And it has #1425 issue too. |
I had a similar issue, also happening only on compilation, but with Prettier and not SvelteKit. Reproduction, in case it helps:
For this code,
Guess I'm pretty lucky this got fixed a few hours before I stumbled upon it ^^ |
* Fixes oven-sh#5178 * Update comment --------- Co-authored-by: Jarred Sumner <[email protected]>
What version of Bun is running?
1.0.1
What platform is your computer?
Darwin 21.6.0 arm64 arm, Mac M1
What steps can reproduce the bug?
Steps to reproduce
Same steps as: https://bun.sh/guides/ecosystem/sveltekit
Error
Notes
Every step of build passes as ok,
bun run dev
andbun build/index.js
work fine.Just that the compiled bun binary cannot start the Sveltekit app and throws the error above.
What is the expected behavior?
Should start server on
localhost:3000
What do you see instead?
No response
Additional information
Same issues - previously closed
#1069
#1070
Other similar issues
#4592
The text was updated successfully, but these errors were encountered: