Comments (4)
Okey, after a few weeks with this headache seems I have found a workaround to fix this temporarily...
Adding the CommonJS dependencies to the vite config avoids being bundled by vite:
In the svelte.config.js
:
const config = {
kit: {
vite: {
ssr: {
noExternal: ['style-value-types', 'popmotion', 'framesync']
}
}
}
}
See sveltejs/kit#928 (comment)
from svelte-motion.
Hey Rick!
I have the same issue you have here, but I think the stopper here is the 'style-value-types' dependency, which fails being loaded by Vite I guess...
11:39:06 PM: > Named export 'alpha' not found. The requested module 'style-value-types' is a CommonJS module, which may not support all module.exports as named exports.
11:39:06 PM: CommonJS modules can always be imported via the default export, for example using:
11:39:06 PM: import pkg from 'style-value-types';
11:39:06 PM: const { number, px, degrees, scale, alpha, progressPercentage, complex, color, filter, percent, vw, vh } = pkg;
11:39:06 PM:
11:39:06 PM: file:///opt/build/repo/.svelte-kit/output/server/app.js:25
11:39:06 PM: import { number, px, degrees, scale, alpha, progressPercentage, complex, color, filter, percent, vw, vh } from "style-value-types";
As the error states, the problem is in the style-value-types
module, which should be ESM and not CommonJS module... but in their repo I don't see any intention to switch it to ESM...
from svelte-motion.
Just saw all this. This work around looks great to me! Thank you
from svelte-motion.
Okey, after a few weeks with this headache seems I have found a workaround to fix this temporarily... Adding the CommonJS dependencies to the vite config avoids being bundled by vite:
In the
svelte.config.js
:const config = { kit: { vite: { ssr: { noExternal: ['style-value-types', 'popmotion', 'framesync'] } } } }
Thanks for that, it worked 👍🏻
from svelte-motion.
Related Issues (20)
- Docs: Scroll example is partially broken HOT 1
- Is this repository still maintained? HOT 2
- Q: Can I use AnimatePresence with SvelteKit to create page transitions? HOT 1
- Pan event trubbel in Google chrome and Opera HOT 1
- 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
- ERROR: Cannot read properties of undefined (reading 'update') HOT 9
- 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
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.