hanvalen
hanvalen
SSolidJS
Created by hanvalen on 1/2/2025 in #support
minified UI library package code calling undefined map
Hi, I have a lot of apps I want to make this year, so figured I should make a UI library for myself so I don't have to make a button or footer or what have you for each app. I am pretty good at the computer, so not daunted, but I'm getting this issue I can't quite figure out on my own and jippity is not helping lol. Basically, I wrote some UI components using tailwind styles, eg:
interface KickerProps {
text: string;
}

export function Kicker({ text }: KickerProps) {
return (
<div class="flex gap-[12px] px-[12px] py-[6px] rounded-[6px] text-[16px] shadow-[0px_4px_4px_0px_rgba(0,0,0,0.25)] max-w-[fit-content]">
<p>{text}</p>
</div>
);
}
interface KickerProps {
text: string;
}

export function Kicker({ text }: KickerProps) {
return (
<div class="flex gap-[12px] px-[12px] py-[6px] rounded-[6px] text-[16px] shadow-[0px_4px_4px_0px_rgba(0,0,0,0.25)] max-w-[fit-content]">
<p>{text}</p>
</div>
);
}
This is just a lil guy that puts some text in a box for use in Heroes and Product Cards and such. I got the thing built, doin all the umd.js and es.js stuff, types are compiling, I get my intellisense in VS Code to import the stuff, but the lib.es.js file is like... broken? I guess? In the dist code, there's a function like
function y(t) {
let i, e;
return !B() || !(i = p.registry.get(e = a())) ? t() : (p.completed && p.completed.add(i), p.registry.delete(e), i);
}
function y(t) {
let i, e;
return !B() || !(i = p.registry.get(e = a())) ? t() : (p.completed && p.completed.add(i), p.registry.delete(e), i);
}
Where p is an alias for the sharedConfig from solid-js - at run time, p.registry is undefined, so I'm calling .get() on undefined, which suuuucks. Idk why the lib.es.js is doing this, and to be completely honest this may be more of a vite thing than a solid thing, but if anyone else has done something similar and seen this before I would have approximately infinite high fives for such a person Another important detail may be that the consuming project is solid start - these metaframeworks are really important for doing SEO and SEO is an important part of lobster-trap apps so TLDR; Working on a UI library, can't use/test it because of weirdness in minified dist code
9 replies