Versions
- Deno version: 2.7.11
- OS: macOS (Darwin)
- TypeScript version (bundled): 5.9.2
Description
When a project has valid JSX-related compilerOptions (jsx and jsxImportSource) in deno.json, running deno check works correctly. However, if a tsconfig.json file exists in the project root (even an empty one), deno check fails with JSX-related TypeScript errors.
It appears that the presence of a tsconfig.json causes Deno to ignore the JSX compiler options defined in deno.json. This issue seems to be specifically related to JSX configuration (jsx and jsxImportSource options).
Reproduction
Minimal reproduction repository: https://github.com/quentinadam/deno-tsconfig-issue
Steps to reproduce:
-
Clone the repository:
git clone https://github.com/quentinadam/deno-tsconfig-issue.git
cd deno-tsconfig-issue
-
Run deno check:
Result: Fails with errors
-
Remove or rename tsconfig.json:
mv tsconfig.json tsconfig.json.bak
deno check Component.tsx
Result: Succeeds
Docker reproduction (clean environment):
docker run --rm -v "$(pwd)":/app -w /app denoland/deno:latest sh -c "
echo '--- With tsconfig.json ---' &&
deno check Component.tsx;
echo '--- Without tsconfig.json ---' &&
mv tsconfig.json tsconfig.json.bak &&
deno check Component.tsx;
mv tsconfig.json.bak tsconfig.json
"
This confirms the issue in a fresh Deno environment with no local cache.
Project structure:
deno.json:
{
"imports": {
"preact": "npm:preact@^10.29.1"
},
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "preact"
}
}
tsconfig.json:
Component.tsx:
export function Component() {
return <div>Hello world</div>;
}
Error output
Check Component.tsx
TS7026 [ERROR]: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.
return <div>Hello world</div>;
~~~~~
at file:///[...]/Component.tsx:2:10
TS2875 [ERROR]: This JSX tag requires the module path 'preact/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed.
return <div>Hello world</div>;
~~~~~~~~~~~~~~~~~~~~~~
at file:///[...]/Component.tsx:2:10
Found 3 errors.
error: Type checking failed.
Expected behavior
According to the Deno TSConfig migration documentation:
If a parent deno.json contains compilerOptions, that will take precedence over any TSConfig.
Based on this documented behavior, deno check should succeed because the compilerOptions in deno.json should take precedence over the empty tsconfig.json. However, this is not what happens in practice for JSX-related options.
Versions
Description
When a project has valid JSX-related
compilerOptions(jsxandjsxImportSource) indeno.json, runningdeno checkworks correctly. However, if atsconfig.jsonfile exists in the project root (even an empty one),deno checkfails with JSX-related TypeScript errors.It appears that the presence of a
tsconfig.jsoncauses Deno to ignore the JSX compiler options defined indeno.json. This issue seems to be specifically related to JSX configuration (jsxandjsxImportSourceoptions).Reproduction
Minimal reproduction repository: https://github.com/quentinadam/deno-tsconfig-issue
Steps to reproduce:
Clone the repository:
git clone https://github.com/quentinadam/deno-tsconfig-issue.git cd deno-tsconfig-issueRun
deno check:Result: Fails with errors
Remove or rename
tsconfig.json:Result: Succeeds
Docker reproduction (clean environment):
This confirms the issue in a fresh Deno environment with no local cache.
Project structure:
deno.json:
{ "imports": { "preact": "npm:preact@^10.29.1" }, "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "preact" } }tsconfig.json:
{}Component.tsx:
Error output
Expected behavior
According to the Deno TSConfig migration documentation:
Based on this documented behavior,
deno checkshould succeed because thecompilerOptionsindeno.jsonshould take precedence over the emptytsconfig.json. However, this is not what happens in practice for JSX-related options.