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

bundle error: Cannot specify --jsx #9308

Closed
AkifumiSato opened this issue Jan 28, 2021 · 4 comments · Fixed by #9407
Closed

bundle error: Cannot specify --jsx #9308

AkifumiSato opened this issue Jan 28, 2021 · 4 comments · Fixed by #9407
Assignees
Labels
bug Something isn't working correctly cli related to cli/ dir

Comments

@AkifumiSato
Copy link
Contributor

deno: 1.7.0

I ran this command because I want to bundle jsx.

deno bundle pages/Index.tsx public/pages/Index.js
error: TS17004 [ERROR]: Cannot use JSX unless the '--jsx' flag is provided.
...

Then I ran it with the --jsx flag.

deno bundle --jsx pages/Index.tsx public/pages/Index.js
error: Found argument '--jsx' which wasn't expected, or isn't valid in this context

Is the error message incorrect, or am I making a mistake?

@ry ry added the bug Something isn't working correctly label Jan 28, 2021
@ry
Copy link
Member

ry commented Jan 28, 2021

I believe you can work around this by using --no-check

@lucacasonato
Copy link
Member

cc @kitsonk

@kitsonk kitsonk added the cli related to cli/ dir label Jan 28, 2021
@kitsonk kitsonk self-assigned this Jan 28, 2021
@amrox
Copy link

amrox commented Feb 2, 2021

if it helps, I hit this too. I was working with the tutorial here https://dev.to/craigmorten/writing-a-react-ssr-app-in-deno-2m7

deno 1.7.1

client.tsx:

import React from "https://dev.jspm.io/[email protected]";
import ReactDOM from "https://dev.jspm.io/[email protected]";
import App from "./app.tsx";

(ReactDOM as any).hydrate(
    <App />,
    //@ts-ignore
    document.getElementById("root"),
);
❯ deno bundle client.tsx                                                                                                                                                                    ~/Projects/deno1
Bundle file:///Users/amrox/Projects/deno1/client.tsx
Check file:///Users/amrox/Projects/deno1/client.tsx
error: TS6142 [ERROR]: Module './app.tsx' was resolved to 'file:///Users/amrox/Projects/deno1/app.tsx', but '--jsx' is not set.
import App from "./app.tsx";
                ~~~~~~~~~~~
    at file:///Users/amrox/Projects/deno1/client.tsx:3:17

TS17004 [ERROR]: Cannot use JSX unless the '--jsx' flag is provided.
    <App />,
    ~~~~~~~
    at file:///Users/amrox/Projects/deno1/client.tsx:6:5
...

--no-check does work around this issue

@ebebbington
Copy link
Contributor

ebebbington commented Feb 2, 2021

Use the config flag with a tsconfig + lib prop should fix this right? without needing to use --no-check

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

Successfully merging a pull request may close this issue.

6 participants