Import in ChipInput conflicts with Svelte 5.56

#717 · closed · 4 comments

View on GitHub ↗

uckelman

**Describe the bug** Relaying an issue raised by Ancora in the Discord support channel: In Svelte 5.56.3, using `@smui-extra/chip-input` causes a runtime failure when importing the `Set` component like this: ``` import Chip, { Set, TrailingAction, Text as ChipText } from '@smui/chips'; ``` This leads to a component_api_invalid_new error, and the application crashes at runtime. The issue appears to be related to how the `Set` component from `@smui/chips` is handled in Svelte 5.56.3. When the component is imported with the name `Set`, it conflicts with Svelte 5’s component instantiation mechanism, resulting in an invalid new usage error. Renaming the import resolves the problem: ``` import Chip, { Set as ChipSet, TrailingAction, Text as ChipText } from '@smui/chips'; ``` The problem does not occur in Svelte 5.55.10; the breaking change is in Svelte 5.56.0. The exception I get is: ``` Uncaught TypeError: can't access property "use", e is undefined Fa props.js:323 ni Set.svelte:131 <anonymous> index.js:11 props.js:323:3 Fa props.js:323 ni Set.svelte:131 <anonymous> index.js:11 ``` **To Reproduce** Use ``` import ChipInput from '@smui-extra/chip-input'; ``` somewhere. **Expected behavior** No uncaught exception at runtime.

Comments

hperrin

Thank you for the report and the detailed analysis.

hperrin

I changed the export name to `ChipSet`, but also exported it as `Set` for backward compatibility.

uckelman

Thanks for fixing this. I'll give it a try in the next day or two.

uckelman

I've updated to svelte 5.56.8 and svelte-material-ui 9.0.3 and the problem is fixed. Thanks!