Closed asode closed 1 year ago
v5 (which is almost ready) uses SvelteKit's package setup so should fix all these issues...
https://github.com/rob-balfre/svelte-select/tree/feature/v5
svelte-select@5.0.0-alpha.10
Thank you for the tip. Unfortunately it still doesn't seem to work. However the error is now different:
/home/asode/coding/svelte-select-test/node_modules/svelte-select/index.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){export { default as default } from './Select.svelte';
^^^^^^
SyntaxError: Unexpected token 'export'
> 4 | import Select from "svelte-select";
| ^
5 |
at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1728:14)
at Object.<anonymous> (src/components/form/InputField.svelte:4:16)
npm list svelte-select
svelte-select-test@0.0.0-development /home/asode/coding/svelte-select-test
└── svelte-select@5.0.0-alpha.10
@asode do you have other external svelte components that are working with your jest setup?
@rob-balfre I'm using svelte-toast and svelte-feather-icons at the moment if those count? I can of course try something else too.
@asode is there a sample repo or something with a svelte+jest setup? The docs are ... interesting!
I've the same issue SyntaxError: Unexpected token 'export'
in tests and build
@rob-balfre It looks like an issue with the latest svelte kit. Try to upgrade it
Any better in latest beta? Thanks
It's broken in the sveltekit as well
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".svelte" for /node_modules/svelte-select/Select.svelte
Not seeing any issues with svelte-select and SvelteKit.
https://stackblitz.com/edit/sveltejs-kit-template-default-4nb4q8?file=src/routes/+page.svelte
Closing this... reopen if still an issue...
I'm trying to run my tests with
jest
andtesting-library
, but for some reason stuck getting the following error:src/components/form/InputField.svelte:87-97
Now I did find some topics with the same error but I think these have been outdated, as the answer recommends transforming the component. When I now look at the package in my
node_modules/svelte-select
folder, there aredist/index.js
anddist/index.mjs
, so transforming shouldn't be required anymore?Kinda surprised this has never been reported here in GH. Have I missed something? Thanks for the help in advance!