kobalte
kobalte copied to clipboard
HiddenSelectBase leads to import "use" from "solid-js/web" in compiled SolidStart output
Describe the bug
I'm currently using SolidUI to add component to my project, since it's a shadcn/ui inspired library and I've located the
usefunction was used by compiledHiddenSelectBasefrom Kobalte so I do not believe it's an issue of SolidUI.
Inside the compiled output, it has this last line:
import { isServer, createComponent, Dynamic, mergeProps as mergeProps$1, memo, use, spread, insert, effect, style, setAttribute, template, Portal, ssr, ssrHydrationKey } from "solid-js/web";
...
function HiddenSelectBase(props) {
...
return (() =>
...
const _ref$ = mergeRefs((el) => ref = el, local.ref);
typeof _ref$ === "function" && use(_ref$, _el$4);
...
Which uses a use function imported from solid-js/web, I think the related ref is defined here.
The problem here is that this use function is not exported from solid-js/web at all (SolidJS version 1.9.3) and I'm so confused why it's introduced here in the compiled codes.
To Reproduce Codesanbox URL
Steps to reproduce the behavior:
- Add Select or Combobox component using SolidUI
- Render it in any route
- Set the server preset to be
cloudflare-pagesinsideapp.config.ts - Run
buildscript
Expected behavior Build output without error.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context
Please help confirm if this is a Kobalte issue or vinxi issue, since this does not break build process of node-server preset but still adds this use import.
I had the same issue; updating to vinxi v0.5.3 solved this issue for me.
Any updates on this? I am still experiencing this issue with the latest version. Even clientOnly is not a cure here. The app is functioning fine, though. Also, I see this error only in the server terminal. Thank you for your awesome library!
import { use, spread, mergeProps, insert, createComponent, effect, style, setAttribute, template } from 'solid-js/web';
^^^
SyntaxError: The requested module 'solid-js/web' does not provide an export named 'use'
Most likely the problem is in the build process.
For some reason, bundler converts the following lines:
<select
ref={mergeRefs((el) => (ref = el), local.ref)}
...
To this:
import { use, ... } from 'solid-js/web';
...
const _ref$ = mergeRefs((el) => ref = el, local.ref);
typeof _ref$ === "function" && use(_ref$, _el$4);
I have the same issue:
Can yall confirm what version of Vinxi, Solid, Solid Start, and Kobalte you're on. Minimal repro would also be nice.
I'll note that John's repro uses "vinxi": "^0.4.3" which I believe is the problem.