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 + jsx syntax #1286

Open
iacore opened this issue Jun 20, 2024 · 3 comments
Open

bun + jsx syntax #1286

iacore opened this issue Jun 20, 2024 · 3 comments

Comments

@iacore
Copy link

iacore commented Jun 20, 2024

I don't know how to let bun parse JSX syntax inside *.civet.

I have bunfig.toml setup as described here.

I have this file.

console.log <a>h</a>

When I try to run it with bun init.civet, it says

❯ bun init.civet
1 | console.log(<a>h</a>)
                     ^
error: Syntax Error!!
    at /home/user/meta/www.self/init.civet:1:18

Bun v1.1.15 (Linux x64)

My tsconfig.json is like this:

{
    "compilerOptions": {
        "jsx": "react-jsx",
        "jsxImportSource": "solid-js",
    }
}
@iacore
Copy link
Author

iacore commented Jun 20, 2024

this also doesn't work as bunfig.toml

jsx = "react-jsx"
jsxImportSource = "solid-js"
preload = ["@danielx/civet/bun-civet"]

@iacore
Copy link
Author

iacore commented Jun 20, 2024

I found civetman + Deno working better 👍

@edemaine
Copy link
Collaborator

The original issue seems to be a bug in Bun: oven-sh/bun#4519

It looks like we could work around it using an explicit Transpiler. Probably worth doing until this gets fixed in Bun.

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

No branches or pull requests

2 participants