cem-tools
cem-tools copied to clipboard
[custom-element-jsx-integration] Error cannot read properties of undefined (reading startsWith')
Hey there! Currently trying to use JSX Integration to generate types for my React 19+ Sandbox. Running into the following error:
Repo: https://github.com/hasanirogers/web-components-reactbox/tree/jsx
Any ideas on what I'm doing wrong? It seems to be reading my components from my custom-elements.json file as it logs their name. My build file looks like:
import { generateJsxTypes } from "custom-element-jsx-integration";
import { readFileSync } from 'fs';
const manifest = JSON.parse(readFileSync(new URL('./node_modules/kemet-ui/custom-elements.json', import.meta.url), 'utf8'));
const options = {
defaultExport: true,
componentTypePath: (name, tag) => {
console.log(name);
return `./node_modules/kemet-ui/dist/components/${tag}/${tag}.d.ts`; // what is this relative to?
}
};
generateJsxTypes(manifest, options);