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
Describe the bug
When generating a solid component, the library/src/index.ts gets updated with a .ts instead of a .tsx import
To Reproduce
npx create-nx-workspace --preset=apps solid-test
cd solid-test
npm i @nxext/solid
nx g @nxext/solid:application apps/app-web
nx g @nxext/solid:lib libs/lib-app-web
nx g @nxext/solid:component hello --project lib-app-web
cat libs/lib-app-web/src/index.ts
Expected behavior libs/lib-app-web/src/index.ts should import Hello or Hello.tsx instead of Hello.ts
Note that using .ts or .tsx causes TS5097: An import path can only end with a .tsx extension when allowImportingTsExtensions is enabled. so if we want to keep with .tsx then we also need to update the tsconfig to allow this.
I expect it'd be better to remove the extension entirely for wider compatibility if built libs need to be used outside of a typescript context. I don't have a lot of experience with this though so maybe someone else can weigh in here.
Additional context
Problem also existed in a pnpm based project. Recreated with npm to remove variables
Describe the bug
When generating a solid component, the library/src/index.ts gets updated with a .ts instead of a .tsx import
To Reproduce
npx create-nx-workspace --preset=apps solid-test cd solid-test npm i @nxext/solid nx g @nxext/solid:application apps/app-web nx g @nxext/solid:lib libs/lib-app-web nx g @nxext/solid:component hello --project lib-app-web cat libs/lib-app-web/src/index.ts
$ cat libs/lib-app-web/src/index.ts
Expected behavior
libs/lib-app-web/src/index.ts
should importHello
orHello.tsx
instead ofHello.ts
Note that using .ts or .tsx causes
TS5097: An import path can only end with a .tsx extension when allowImportingTsExtensions is enabled.
so if we want to keep with.tsx
then we also need to update the tsconfig to allow this.I expect it'd be better to remove the extension entirely for wider compatibility if built libs need to be used outside of a typescript context. I don't have a lot of experience with this though so maybe someone else can weigh in here.
Additional context
Problem also existed in a pnpm based project. Recreated with npm to remove variables
The text was updated successfully, but these errors were encountered: