svelte-multiselect icon indicating copy to clipboard operation
svelte-multiselect copied to clipboard

Error using svelte-multiselect in Svelte REPL

Open otprocta opened this issue 3 years ago • 3 comments

Svelte-MultiSelect no longer works in the Svelte REPL.

Screen Shot 2022-04-27 at 12 41 50 AM

otprocta avatar Apr 26 '22 23:04 otprocta

@otprocta Thanks for reporting. Looks like something went wrong in the transition from v4 to v5. Just looked in the package folder at generated files. MultiSelect.svelte now has a weird remnant from a type import line

import './';

that used to be removed entirely. Not sure if that's the cause for this error. Need to investigate more. As a short-term fix, you can append package version numbers onto NPM imports. Your error disappears if you use the latest v4 release:

-  import MultiSelect from 'svelte-multiselect'
+  import MultiSelect from '[email protected]'

janosh avatar Apr 27 '22 09:04 janosh

Unfortunately these errors are hard to troubleshoot in the REPL due to lack of stack trace (outstanding issue https://github.com/sveltejs/sites/issues/173) and I can't reproduce locally.

janosh avatar Apr 27 '22 09:04 janosh

@otprocta Small update: this might be an issue with the Svelte REPL and not with MultiSelect. Follow https://github.com/sveltejs/sites/issues/354 for further developments.

janosh avatar Jul 14 '22 09:07 janosh

Just noticed the latest version 7.0.2 of svelte-multiselect runs in the Svelte REPL successfully. All versions from 5.0.0 to 7.0.1 still error:

Unexpected token (Note that you need plugins to import files that are not JavaScript)

Looks like removing the circular import between src/lib/{index.ts<->MultiSelect.svelte} in #131 also solved this error.

janosh avatar Oct 17 '22 01:10 janosh