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

Bun crashes when building empty css file with --experimentalCss #14487

Open
Voldemortas opened this issue Oct 11, 2024 · 1 comment · May be fixed by #14499
Open

Bun crashes when building empty css file with --experimentalCss #14487

Voldemortas opened this issue Oct 11, 2024 · 1 comment · May be fixed by #14499
Assignees
Labels
crash An issue that could cause a crash css CSS parser, bundler-related linux An issue that occurs on Linux

Comments

@Voldemortas
Copy link

Voldemortas commented Oct 11, 2024

How can we reproduce the crash?

//Component.tsx

import React from 'react'
import './styles.css'

export default function Whatever() {
  return <div>dsfsdf</div>
}

The styles.css file exists but it's empty

//build.ts

await Bun.build({
  entrypoints: ['Component.tsx'],
  outdir: "out",
  experimentalCss: true,
})

and doing bun run build.ts gives the seg fault

it works fine if styles.css has anything (even comments)

Relevant log output

panic: Segmentation fault at address 0x8
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

Stack Trace (bun.report)

Bun v1.1.30 (7996d06) on linux x86_64 [RunCommand]

Segmentation fault at address 0x00000008

Features: Bun.stderr, Bun.stdout, jsc, shell, spawn, transpiler_cache, tsconfig

@Voldemortas Voldemortas added the crash An issue that could cause a crash label Oct 11, 2024
@github-actions github-actions bot added the linux An issue that occurs on Linux label Oct 11, 2024
@Jarred-Sumner Jarred-Sumner added the css CSS parser, bundler-related label Oct 11, 2024
@versecafe
Copy link
Contributor

Going to take a pass at this, just to note in case anyone comes on this, as long as the file contains anything besides new lines, even if it's just junk chars or comment blocks works, it probably shouldn't bundle out a css file if there isn't any css but it does currently make

/* styles.css */

white space is part of this

@zackradisic zackradisic linked a pull request Oct 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash An issue that could cause a crash css CSS parser, bundler-related linux An issue that occurs on Linux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants