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
I have a TypeScript dependency (Not transpiled) that uses the alternative cast syntax (<any>{} instead of {} as any), which is allowed in ".ts" files but not in ".tsx".
When I import that dependency it throws a syntax error because EVERY file is interpreted as TSX
Expected behavior 🤔
Normal ".ts" files should NOT behave as ".tsx"
Steps to reproduce 🕹
Steps:
Create a new bare Solid Start project with TypeScript (npm init solid)
Go inside the "src" directory and create a file named "a.ts" containing export default <any>{};
Add this (↓) to "app.tsx"
importafrom"./a";console.log(a);
You'll get an error like this one
Context 🔦
I tried specifying the extensions option in the config, but here it's being added instead of overriding the default one
This is just a partial suggestion, since I noticed that doing this has the side effect of breaking ".ts" API routes
Your environment 🌎
I don't know what command you are talking about, sorry (Luckily, I don't think it matters anyway)
System:
OS: Windows 11
CPU: (16) x64
Binaries:
Node: v22.8.0
npm: 10.8.2
npmPackages:
@solidjs/[email protected][email protected][email protected]
The text was updated successfully, but these errors were encountered:
Duplicates
Latest version
Current behavior 😯
I have a TypeScript dependency (Not transpiled) that uses the alternative cast syntax (
<any>{}
instead of{} as any
), which is allowed in ".ts" files but not in ".tsx".When I import that dependency it throws a syntax error because EVERY file is interpreted as TSX
Expected behavior 🤔
Normal ".ts" files should NOT behave as ".tsx"
Steps to reproduce 🕹
Steps:
npm init solid
)export default <any>{};
You'll get an error like this one
Context 🔦
I tried specifying the
extensions
option in the config, but here it's being added instead of overriding the default oneI suggest changing that line into
Or even better, this one into
Note
This is just a partial suggestion, since I noticed that doing this has the side effect of breaking ".ts" API routes
Your environment 🌎
The text was updated successfully, but these errors were encountered: