The requested module 'solid-js/web' does not provide an export named 'use'
I have a monorepo setup with a solid-start main app, and some packages
One of the local packages has a dependency on https://github.com/andi23rosca/tiptap-solid
Trying to use the tiptap-solid package results in this error:
The requested module 'solid-js/web' does not provide an export named 'use'
And looking at the dist files of tipta-solid, the first line is importing that: import { use, insert, effect, className, spread, createComponent, Dynamic, mergeProps, template } from 'solid-js/web';
The weird thing is that there's an ssr test in tiptap-solid that mounts the component I'm trying to use and that works fine, so I'm not sure what could cause this issue in my solid-start app
Any help is appreciated 🙏GitHub
GitHub - andi23rosca/tiptap-solid
Contribute to andi23rosca/tiptap-solid development by creating an account on GitHub.
3 Replies
A bit more context on that error:
use
is a thing that dom-expressions imports when a client side bundle uses a directive. However, it shouldn't be included at all when rendering on the server
In other words, that happens when a server side bundle tries to import a Solid library that has been pre-compiled for the client.
Is it possible the local package is a client-only package?I sometimes get this error when I import a component from a wrong sub directory of a lib. Vscode sometimes suggest weird sub dirs as the first entry of suggestions.
Any updates on this? I'm also trying to use solid in a monorepo setup and also got the same error when trying to consume my compiled component package. At some point I gave up and now I'm using my package directly, without a compile step. But I think this prevents me from caching the component package and therefore keeps me from speeding up my main build step.
I think an example mono repo setup from solid would be very nice.