SolidJSS
SolidJSโ€ข2y agoโ€ข
22 replies
Erik Demaine

Dependency configuration in Astro

I'm trying to add solid-bootstrap as a dependency in an Astro + Solid project. This results in the solid export flag being turned on, so solid-bootstrap exports dist/esm/index.jsx by default. Then I get the error Could not import ./Accordion, I guess because .jsx isn't getting resolved as a default extension.

I feel like this is probably standard... Is there some Vite configuration I should add? I tried
vite: {
    optimizeDeps: {include: 'solid-bootstrap'},
    ssr: {noExternal: ['solid-bootstrap']},
  },

(and also optimizeDeps.exclude) but didn't see any difference.
Alternatively, is solid-bootstrap doing something wrong? I thought it worked with SSR... But maybe not Astro?
Was this page helpful?