You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I give tsx a tsconfig path that's a direct ancestor of the source directory then it is used as expected, but if I give it a tsconfig that's in a sibling directory then it appears to be silently ignored.
Details
I'm trying to use tsx to dynamically import jsx rendered using nano-jsx rather than React. Doing that requires configuring typescript's jsxImportSource compiler option, which in turn means providing a tsconfig.json file to tsx. For reasons that are a bit complex to get into, I sometimes need to keep that tsconfig.json outside of the folder heirarchy of the source I'm executing (my program is operating on externally provided files and I don't have permissions to add a tsconfig.json there).
What I've discovered is that tsx appears to silently ignores the compiler options of a tsconfig.json file if that file is outside of the source files' directory heirarchy.
Contributions
I plan to open a pull request for this issue
I plan to make a financial contribution to this project
The text was updated successfully, but these errors were encountered:
You'd probably need to use tsconfig's include directive for esbuild to process the source code. It looks like it's not present anywhere in your minimal reproduction repo.
You'd probably need to use tsconfig's include directive for esbuild to process the source code. It looks like it's not present anywhere in your minimal reproduction repo.
Thanks @busybox11, this worked! I don't really understand why though.
Acknowledgements
Minimal reproduction URL
https://stackblitz.com/edit/node-49eqfc?file=README.md
Version
4.7.0
Node.js version
18.18.0
Package manager
pnpm
Operating system
Linux
Problem & Expected behavior
TL;DR
If I give tsx a tsconfig path that's a direct ancestor of the source directory then it is used as expected, but if I give it a tsconfig that's in a sibling directory then it appears to be silently ignored.
Details
I'm trying to use tsx to dynamically import jsx rendered using nano-jsx rather than React. Doing that requires configuring typescript's
jsxImportSource
compiler option, which in turn means providing a tsconfig.json file to tsx. For reasons that are a bit complex to get into, I sometimes need to keep that tsconfig.json outside of the folder heirarchy of the source I'm executing (my program is operating on externally provided files and I don't have permissions to add a tsconfig.json there).What I've discovered is that tsx appears to silently ignores the compiler options of a tsconfig.json file if that file is outside of the source files' directory heirarchy.
Contributions
The text was updated successfully, but these errors were encountered: