NX setup with SolidJS and React

I have a monorepo where I create web components with SolidJS and take them into use in React. The app runs fine and individual libs builds ok, but I get error when I build React app:
libs\shared\ui\components\src\lib\tree\LoadableTreeAction.tsx:17:3 - error TS2322: Type 'import("C:/clients/node_modules/.pnpm/@[email protected]/nod
e_modules/@types/react/jsx-runtime").JSX.Element' is not assignable to type 'import("C:/clients/node_modules/.pnpm/[email protected]/node_modules/solid-js/types/jsx").JSX.Element'.
15 | props
16 | ): JSX.Element => {
> 17 | return (
| ^
18 | <Show
libs\shared\ui\components\src\lib\tree\LoadableTreeAction.tsx:17:3 - error TS2322: Type 'import("C:/clients/node_modules/.pnpm/@[email protected]/nod
e_modules/@types/react/jsx-runtime").JSX.Element' is not assignable to type 'import("C:/clients/node_modules/.pnpm/[email protected]/node_modules/solid-js/types/jsx").JSX.Element'.
15 | props
16 | ): JSX.Element => {
> 17 | return (
| ^
18 | <Show
For serving I have this setup in vite.config.mts for React app:
resolve: {
alias: {
'@t/web-components': path.resolve(
__dirname,
'../../dist/libs/packages/t-web-components'
),
},
},
resolve: {
alias: {
'@t/web-components': path.resolve(
__dirname,
'../../dist/libs/packages/t-web-components'
),
},
},
Probably I need something similar for building. Maybe someone has ideas about this?
2 Replies
Brendonovich
Brendonovich2w ago
That's a typescript error, looks like one of your packages is using React JSX instead of Solid?
karolisk
karoliskOP2w ago
There is no error in IDE itself. The app itself is in React. Also there is one React based lib as a dependency, but I don't think that could affect anything. as a workaround I added:
"compilerOptions": {
"noCheck": true
},
"compilerOptions": {
"noCheck": true
},

Did you find this page helpful?