Skip to content

Can not build JSX with namespace since 0.11.0 #211

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

Closed
TonyRL opened this issue May 7, 2025 · 2 comments
Closed

Can not build JSX with namespace since 0.11.0 #211

TonyRL opened this issue May 7, 2025 · 2 comments
Labels
bug Something isn't working upstream

Comments

@TonyRL
Copy link

TonyRL commented May 7, 2025

Reproduction link or steps

https://github.com/TonyRL/tsdown-jsx-repro

What is expected?

A successful build just like v0.10.2 and before.

What is actually happening?

Build failed
ℹ [ESM] Build start

  ERROR  Error: Build failed with 1 error:

[UNHANDLEABLE_ERROR] Error: Something went wrong inside rolldown, please report this problem at https://github.com/rolldown/rolldown/issues.
Transform failed, got [
    OxcDiagnostic {
        inner: OxcDiagnosticInner {
            message: "Namespace tags are not supported by default. React's JSX doesn't support namespace tags. You can set `throwIfNamespace: false` to bypass this warning.",
            labels: Some(
                [
                    LabeledSpan {
                        label: None,
                        span: SourceSpan {
                            offset: SourceOffset(
                                328,
                            ),
                            length: 7,
                        },
                        primary: false,
                    },
                ],
            ),
            help: None,
            severity: Warning,
            code: OxcCode {
                scope: None,
                number: None,
            },
            url: None,
        },
    },
]

    at normalizeErrors (file://tsdown-jsx-repro/node_modules/.pnpm/rolldown@1.0.0-beta.8-commit.534fde3/node_modules/rolldown/dist/shared/src-DN7it0tm.mjs:2198:18)
    at handleOutputErrors (file://tsdown-jsx-repro/node_modules/.pnpm/rolldown@1.0.0-beta.8-commit.534fde3/node_modules/rolldown/dist/shared/src-DN7it0tm.mjs:4331:34)
    at transformToRollupOutput (file://tsdown-jsx-repro/node_modules/.pnpm/rolldown@1.0.0-beta.8-commit.534fde3/node_modules/rolldown/dist/shared/src-DN7it0tm.mjs:4325:2)
    at RolldownBuild.write (file://tsdown-jsx-repro/node_modules/.pnpm/rolldown@1.0.0-beta.8-commit.534fde3/node_modules/rolldown/dist/shared/src-DN7it0tm.mjs:5550:11)
    at async build (file://tsdown-jsx-repro/node_modules/.pnpm/rolldown@1.0.0-beta.8-commit.534fde3/node_modules/rolldown/dist/shared/src-DN7it0tm.mjs:5595:22)
    at async file://tsdown-jsx-repro/node_modules/.pnpm/tsdown@0.11.1_typescript@5.8.3_unplugin-lightningcss@0.3.3/node_modules/tsdown/dist/index.js:592:5
    at async Promise.all (index 0)
    at async rebuild (file://tsdown-jsx-repro/node_modules/.pnpm/tsdown@0.11.1_typescript@5.8.3_unplugin-lightningcss@0.3.3/node_modules/tsdown/dist/index.js:583:3)
    at async buildSingle (file://tsdown-jsx-repro/node_modules/.pnpm/tsdown@0.11.1_typescript@5.8.3_unplugin-lightningcss@0.3.3/node_modules/tsdown/dist/index.js:575:2)
    at async Promise.all (index 0)
    at async build (file://tsdown-jsx-repro/node_modules/.pnpm/tsdown@0.11.1_typescript@5.8.3_unplugin-lightningcss@0.3.3/node_modules/tsdown/dist/index.js:547:19)
    at async CAC.<anonymous> (file://tsdown-jsx-repro/node_modules/.pnpm/tsdown@0.11.1_typescript@5.8.3_unplugin-lightningcss@0.3.3/node_modules/tsdown/dist/run.js:20:2)
    at async runCLI (file://tsdown-jsx-repro/node_modules/.pnpm/tsdown@0.11.1_typescript@5.8.3_unplugin-lightningcss@0.3.3/node_modules/tsdown/dist/run.js:38:3) {
  errors: [Getter/Setter]
}

Any additional comments?

It seems that there are no ways to set throwIfNamespace: false to rolldown.

When I tried to override inputOptions, the jsx option only allows https://github.com/rolldown/rolldown/blob/f932e9e5c33e6d132f44c972c6fb18e08ebc2d3d/packages/rolldown/src/options/input-options.ts#L224.
When I tried to override the jsx key in transform option, jsx is also omitted https://github.com/rolldown/rolldown/blob/f932e9e5c33e6d132f44c972c6fb18e08ebc2d3d/packages/rolldown/src/options/input-options.ts#L18 which means I can't change throwIfNamespace https://github.com/rolldown/rolldown/blob/f932e9e5c33e6d132f44c972c6fb18e08ebc2d3d/packages/rolldown/src/binding.d.ts#L1091.

Related: DIYgod/RSSHub#19034

@sxzz
Copy link
Member

sxzz commented May 8, 2025

@sxzz
Copy link
Member

sxzz commented May 8, 2025

As a workaround, you can set target to false.

@sxzz sxzz closed this as completed in 012b9fc May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream
Projects
None yet
Development

No branches or pull requests

2 participants