Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

svelte-motion is completely broken when using with sveltekit... #13

Closed
rchrdnsh opened this issue Dec 7, 2021 · 2 comments
Closed

svelte-motion is completely broken when using with sveltekit... #13

rchrdnsh opened this issue Dec 7, 2021 · 2 comments

Comments

@rchrdnsh
Copy link

rchrdnsh commented Dec 7, 2021

I'm trying to use svelte-motion in sveltekit using the latest version (201 at the time of this issue) and the whole thing won't run in dev mode due to svelte-motion not working properly with the following errors:

rchrdnsh@RN RYKR-kit % npm run dev

> rykr-kit@0.0.1 dev
> svelte-kit dev

(node:44531) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /Users/rchrdnsh/Code/Svelte/RYKR-kit/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)
> The following dependencies are imported but could not be resolved:

  @emotion/is-prop-valid (imported by /Users/rchrdnsh/Code/Svelte/RYKR-kit/node_modules/svelte-motion/src/render/dom/utils/filter-props.js)

Are they installed?
Error: The following dependencies are imported but could not be resolved:

  @emotion/is-prop-valid (imported by /Users/rchrdnsh/Code/Svelte/RYKR-kit/node_modules/svelte-motion/src/render/dom/utils/filter-props.js)

Are they installed?
    at optimizeDeps (/Users/rchrdnsh/Code/Svelte/RYKR-kit/node_modules/vite/dist/node/chunks/dep-7e125991.js:63749:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOptimize (/Users/rchrdnsh/Code/Svelte/RYKR-kit/node_modules/vite/dist/node/chunks/dep-7e125991.js:67764:48)
    at async Server.httpServer.listen (/Users/rchrdnsh/Code/Svelte/RYKR-kit/node_modules/vite/dist/node/chunks/dep-7e125991.js:67780:21)
9:29:08 AM [vite-plugin-svelte] The following packages did not export their `package.json` file so we could not check the "svelte" field. If you had difficulties importing svelte components from a package, then please contact the author and ask them to export the package.json file.
- style-value-types
- popmotion
- framesync

...so now I'm completely dead in the water with sveltekit app development until this is fixed or...i delete svelte-motion entirely from the codebase, I guess...which I would rather not do, of course :-)

Any idea what is going on and how to fix it?

@rchrdnsh rchrdnsh changed the title issue with importing stuff in svetlekit... svelte-motion is completely broken when using with sveltekit... Dec 7, 2021
@Marcosaurios
Copy link

I think it has to do with the way you are bundling this dependency in svelte kit vite´s config. See sveltejs/kit#928 (comment)

In your svelte.config.js file, under the vite object settings, add:

	ssr: {
		noExternal: ['style-value-types', 'popmotion', 'framesync']
	}

Refer to https://kit.svelte.dev/docs/configuration for more information

@rchrdnsh
Copy link
Author

yes, thank you. I found this answer a while back but totally forgot about this issue. Will close it out now, thank you for reminding me :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants