Comments (9)
I started a new sveltekit app from the template today. I tried basic motion and some layout effects and both worked. Sveltekit version is "1.0.0-next.483", but I also downgraded to "1.0.0-next.480" without problems. Do you have a little more information, since there seems to be no general problem with sveltekit?
from svelte-motion.
ok, so i did the same thing...
- made a new svelte todo app using
npm create svelte@latest
- installed svelte-motion using
npm install --save-dev svelte-motion
- copied and pasted this example into a new svelte page:
https://svelte.dev/repl/4cbff886878c4b59beda7a1e0108c233?version=3.38.2
...and it worked just fine.
I then copied this REPL into the same page, completely replacing the other example:
https://svelte.dev/repl/0f586143c38f4a2599e5f3fbf9789ec3?version=3.38.2
...and immediately got the following error:
...in text form:
[HMR][Svelte] Unrecoverable HMR error in <Measure>: next update will trigger a full reload
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'update')
at instance (Measure.svelte:102:34)
at init (index.mjs:1892:11)
at new Measure (Measure.svelte:75:46)
at createProxiedComponent (svelte-hooks.js?v=42b7b71c:341:9)
at new ProxyComponent (proxy.js?v=42b7b71c:242:7)
at new Proxy<Measure> (proxy.js?v=42b7b71c:349:11)
at create_fragment (MeasureContextProvider.svelte:12:43)
at init (index.mjs:1907:37)
at new MeasureContextProvider (MeasureContextProvider.svelte:16:27)
at createProxiedComponent (svelte-hooks.js?v=42b7b71c:341:9)
...which I think is the same or similar error I was running into with the OP...I also found out that svelte-motion DOES INDEED work in production, so I'm running into the error in development mode...
...in the case of the project I am using svelte-motion in I am able to get around this error by not using the <MotionConfig>
component, but no animations are occurring for me either...no errors as well...just no animations actually running in dev mode...the animations DO work in production...dunno what that means yet, however...
from svelte-motion.
hmmmm...I fully deleted svelte-motion
and reinstalled it from the command line and it finally installed 0.11.3
and now I'm getting these errors everywhere on every page and nothing using svelte-motion seems to work...
from svelte-motion.
Sounds like a HMR issue, does a full page reload (F5) help?
from svelte-motion.
every full page reload produces the same error for me. This is essentially making the entire app unusable at this point...
This is the code at line 102 in the Motion.svelte
file, if this helps at all:
scaleCorrectionParentContext.update((v) =>
v.concat([{
updater,
afterU
} ])
);
afterUpdate(afterU);
...been trying to figure things out, but I admittedly don't know the codebase for either svelte/kit or svelte-motion, so I'm kind of fumbling in the dark...
from svelte-motion.
looking to see if i can disable HMR in vite or kit ATM...
from svelte-motion.
Tried doing this in the vite.config.js
file, but still getting the same errors:
const config = {
server: {
hmr: false
},
from svelte-motion.
Thank you, I was able to replicate the error. Quick fix is to change the import from
import Motion from 'svelte-motion/src/motion/MotionSSR.svelte';
to
import {Motion} from 'svelte-motion';
I try to fix the SSR component in the meantime. Sveltekit has become quite robust, there seems to be no need for special Server-/Clientside-handling anymore. It is still needed for REPL at this point.
from svelte-motion.
yay, that is indeed working for me now, thank you!
This also seems like a good thing now, yes? The ideal situation would be to not have to import an maintain a separate SSR component, correct?
Anyway, it is indeed working for me now, so thank you very much :-)
from svelte-motion.
Related Issues (20)
- AnimateSharedLayout TS type error with svelte kit HOT 1
- Noticing a 1 pixel shift during animation... HOT 1
- How to fill AnimatePresence list prop if there is only 1 child
- Animate on unmount
- AnimatePresence onUpdate/exit is broken after HMR happens
- Type checking disable for whileDrag HOT 1
- Getting odd warning? svelte is the type in package.json? HOT 2
- Add a Changelog
- New breaking error with latest kit and vite 4.0.0... HOT 8
- Why use tslib? HOT 2
- Animations don't load/run when built statically HOT 2
- useInView hook would be useful
- How can I use useDragControls HOT 2
- Animate Presences
- Is this library still actively maintained? HOT 16
- Style Tags on MotionDiv elements not working
- Svelte svg M not working
- style motion props not working as expected HOT 1
- Typescript update PR HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svelte-motion.