diff --git a/.changeset/tangy-chicken-tell.md b/.changeset/tangy-chicken-tell.md new file mode 100644 index 0000000000..af630d0f1f --- /dev/null +++ b/.changeset/tangy-chicken-tell.md @@ -0,0 +1,7 @@ +--- +"@gradio/app": patch +"@gradio/preview": patch +"gradio": patch +--- + +fix:Gradio custom component dev mode now detects changes to Example.svelte file diff --git a/js/app/component_loader.js b/js/app/component_loader.js index 327682a199..55caabb6b5 100644 --- a/js/app/component_loader.js +++ b/js/app/component_loader.js @@ -9,7 +9,6 @@ export async function load_component({ api_url, name, id, variant }) { ...(!comps ? {} : comps) }; try { - //@ts-ignore const c = await ( _component_map?.[id]?.[variant] || // for dev mode custom components _component_map?.[name]?.[variant] diff --git a/js/preview/src/dev.ts b/js/preview/src/dev.ts index 12951a0d3b..c64bd6584b 100644 --- a/js/preview/src/dev.ts +++ b/js/preview/src/dev.ts @@ -122,13 +122,13 @@ function generate_imports(component_dir: string, root: string): string { ); const exports: Record = { - component: pkg.exports["."] as string, - exmaple: pkg.exports["./example"] as string + component: pkg.exports["."], + example: pkg.exports["./example"] }; const example = exports.example ? `example: () => import("${to_posix( - join(component.frontend_dir, "example") + join(component.frontend_dir, exports.example) )}"),\n` : ""; return `${acc}"${component.component_class_id}": {