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 1.1.28 -> ReferenceError: Can't find variable: Fragment #14021

Open
aralroca opened this issue Sep 18, 2024 · 2 comments
Open

Bun 1.1.28 -> ReferenceError: Can't find variable: Fragment #14021

aralroca opened this issue Sep 18, 2024 · 2 comments
Assignees
Labels
bug Something isn't working regression

Comments

@aralroca
Copy link
Contributor

What version of Bun is running?

1.1.28+cf4e9cb69

What platform is your computer?

Darwin 23.6.0 arm64 arm

What steps can reproduce the bug?

In the new version of Bun, it doesn't detect the Fragment variable even if I have it in an import directly from JSX-runtime.

What is the expected behavior?

That it uses correctly the direct fragment of the import. It crashes in the test and also in build who uses this component that has this import, for something the build is not done well.

import { Fragment } from '@/jsx-runtime';

// This now shows an error:
return <Fragment>foo</Fragment>

What do you see instead?

I see this error:

 97 |         >
 98 |           {content}
 99 |           {style.length > 0 && <style>{toInline(style)}</style>}
100 |         </template>
101 |       )}
102 |       <Fragment slot="">{props.children}</Fragment>
                                                ^
ReferenceError: Can't find variable: Fragment

Additional information

vid.mov

In this video is better to see the error.

@aralroca aralroca added bug Something isn't working needs triage labels Sep 18, 2024
@paperdave paperdave self-assigned this Sep 18, 2024
@aralroca
Copy link
Contributor Author

@paperdave I sent you an invitation to the repo, to reproducite it just bun test packages/brisa/src/utils/ssr-web-component/index.test.tsx.

@EvHaus
Copy link

EvHaus commented Sep 19, 2024

I'm also running into this but with import {Fragment} from 'react'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression
Projects
None yet
Development

No branches or pull requests

3 participants