Bun Build Fails with CSS URL Data Schemes
17 posts since Jan 2025, all from GitHub.
“What version of Bun is running? 1.4.4 What platform is your computer? Linux 7.3.3 x86 64 unknown What steps can reproduce the bug? src/server.tsx : Each HTML page links a stylesheet and has no”
“What happens On Windows, bun plugin tailwind 0.1.2 emits a relative CSS url() rebased with POSIX path rules, so a drive qualified source path is treated as a relative path and the URL climbs out of the drive: Bun then fails the build because that relative URL does not exist. The…”
“What version of Bun is running? 1.4.4+38afee6c8 What platform is your computer? Linux 7.3.1 1 cachyos x86 64 What steps can reproduce the bug? What is the expected behavior? That the file bundles without errors. content:”
Users are experiencing build failures in Bun when using CSS URLs that include data schemes, indicating a problem with how Bun handles these specific types of URLs during the build process.
SOURCES (17)
“What version of Bun is running? 1.4.4 What platform is your computer? Linux 7.3.3 x86 64 unknown What steps can reproduce the bug? src/server.tsx : Each HTML page links a stylesheet and has no <script tag. What is the expected behavior? bun dist/server.js serves the…”
“What happens On Windows, bun plugin tailwind 0.1.2 emits a relative CSS url() rebased with POSIX path rules, so a drive qualified source path is treated as a relative path and the URL climbs out of the drive: Bun then fails the build because that relative URL does not exist. The same stylesheet builds correctly on macOS and Linux. Where this belongs The published package's metadata points at tailwindlabs/tailwindcss ( repository.directory: packages/@tailwindcss bun , bugs at that repo's issues),”
“What version of Bun is running? 1.4.4+38afee6c8 What platform is your computer? Linux 7.3.1 1 cachyos x86 64 What steps can reproduce the bug? What is the expected behavior? That the file bundles without errors. content: <content list / <alt text is valid CSS, and using it as an @supports condition is the usual way to detect alt text support for generated content. What do you see instead? Additional information I encountered this issue by using the code block components from shadcn. It uses a ta”
“What version of Bun is running? 1.4.2+744846f84 (1.3.5 does the same) What platform is your computer? Linux 7.0.0 1012 aws x86 64 What steps can reproduce the bug? What is the expected behavior? The build finds C /logo.png and prints url("./logo 68tr27nb.png?v=2") . What do you see instead? url("./C /logo.png") resolves, and url("./logo.png?v=2") resolves. The two together do not. Additional information I found this when I worked on 43907. No user reported it. esbuild 0.18.6 fails the same way (”
“What version of Bun is running? 1.4.2+744846f84 (1.3.5 does the same) What platform is your computer? Linux 7.0.0 1012 aws x86 64 What steps can reproduce the bug? What is the expected behavior? A URL that a browser resolves to the copied file out/icon 1 68tr27nb.png , for example url("./icon%231 68tr27nb.png") . What do you see instead? A browser ends the path at the and requests ./icon , which does not exist. (1.4.0 to 1.4.2 also append 1.png . That part is 43907.) The same happens for a ? or”
“What version of Bun is running? 1.4.2+744846f84 (the change that causes it is in the 1.4.0, 1.4.1 and 1.4.2 tags, and main at 73df7bb270 has it too) What platform is your computer? Linux 7.0.0 1012 aws x86 64 What steps can reproduce the bug? What is the expected behavior? Bun 1.3.5 prints this. esbuild 0.18.6 prints url(./logo DFVMILRG.png) for the same input. What do you see instead? The text after the first or ? of the specifier is appended to the rewritten URL, although it is part of the fil”
“What version of Bun is running? 1.4.3. The same on main (f5649a7edb). What platform is your computer? Linux x64 (not platform specific) What steps can reproduce the bug? in.css : What is the expected behavior? No warning. Each construct is in a CSS specification and ships in a browser. lightningcss, which the CSS parser in Bun is a port of, parses all eight with no warning. What do you see instead? Eight warnings. The output is correct: each rule is passed through as written. Additional informat”
“What version of Bun is running? 1.3.14 What platform is your computer? Microsoft Windows NT 10.0.26100.0 x64 What steps can reproduce the bug? Create style.css : Run: bun build style.css outdir out It also reproduces when the CSS is imported from JavaScript: bun build index.js outdir out What is the expected behavior? Bun should not panic. It should either build the CSS, preserve the URL, or report a normal parse/resol What do you see instead? Additional information Crash report URL: https://bun”
“What version of Bun is running? 1.3.10+30e609e08 What platform is your computer? Darwin 24.3.0 arm64 arm What steps can reproduce the bug? When I import two CSS files in sequence, the order produced by Bun.serve is inconsistent with that of Bun.build . For example, if I import foo.css first and then bar.css , Bun.serve ends up importing the latter first; this leads to CSS override issues. I declared different foobar values in two separate CSS files; however, only the result from Bun.build (img”
“What version of Bun is running? 1.3.8+b64edcb49 What platform is your computer? Windows 11 x64 (pt BR) What steps can reproduce the bug? <html <body <html <head </head <body <h1 Severe GC performance regression with basedpyright language server</h1 <h2 Environment</h2 <ul <li <strong Bun version</strong : 1.3.8 (also tested on 1.3.5)</li <li <strong OS</strong : Windows 11</li <li <strong basedpyright version</strong : 1.37.4</li </ul <h2 Description</h2 <p Basedpyright LSP autocomplete operatio”
“What version of Bun is running? 1.3.8 What platform is your computer? Darwin 24.6.0 arm64 arm What steps can reproduce the bug? 1. create an html file with: an img tag and a css file 2. link the same image using src=".../img.webp" from the HTML file, and with url(".../img.webp") from the css file 3. use a small enough image. 4. bun run build What is the expected behavior? the image should appear in the dist folder, like img 2d1ksj3.webp , and used by both css and html files. What do you see inst”
“What version of Bun is running? 1.3.0+b0a6feca5 What platform is your computer? Linux 5.15.167.4 microsoft standard WSL2 x86 64 x86 64 What steps can reproduce the bug? 1. Create a project using a framework like Astro that bundles CSS and assets. (In my case, Astro with Svelte and Tailwind CSS). 2. In a CSS file, reference a background image using a root relative path. For example: background image: url('/background.webp'); 3. Ensure the background.webp image is placed in the public directory so”
“What version of Bun is running? 1.3.0+b0a6feca5 What platform is your computer? Darwin 24.6.0 arm64 arm What steps can reproduce the bug? Start a new Bun 1.3 app with Then compile a single executable file by running: Finally, start the app Everything works, excepts the Tailwind classes are not processed What is the expected behavior? The app would have Tailwind CSS classes compiled, just as when bun dev or bun start What do you see instead? Tailwind CSS classes are not compiled. Everything else”
“What version of Bun is running? 1.2.15+df017990a What platform is your computer? Microsoft Windows NT 10.0.26100.0 x64 What steps can reproduce the bug? Have a file src/index.ts with the contents console.log("Hello Bun"); (actual contents of file are irrelevant to the error, but it existing is important as is referenced in package.json ) Have the following package.json: run $ bun install run $ bun run bundle Windows will refuse to run the script and throw a banner saying to contact y'all Running”
“What version of Bun is running? 1.2.1+ce532901c What platform is your computer? Microsoft Windows NT 10.0.26100.0 x64 What steps can reproduce the bug? Given the following file index2.html Running bun build And the produced output references that empty js file What is the expected behavior? No generated js file in the output. What do you see instead? See repro steps Additional information No response”
“What version of Bun is running? 1.2.1+ce532901c What platform is your computer? No response What steps can reproduce the bug? app.ts index.html What is the expected behavior? Expected behavior is that image.png is correctly hashed and served from the web server. What do you see instead? The image path is not updated and it is not served by the web server. Additional information No response”
