SolidJSS
SolidJSโ€ข10mo agoโ€ข
3 replies
karolisk

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/@types+react@18.3.18/nod
e_modules/@types/react/jsx-runtime").JSX.Element' is not assignable to type 'import("C:/clients/node_modules/.pnpm/solid-js@1.9.5/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'
      ),
    },
  },

Probably I need something similar for building.

Maybe someone has ideas about this?
Was this page helpful?