-
-
Notifications
You must be signed in to change notification settings - Fork 772
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
The requested module '@glidejs/glide' does not provide an export named 'default' #674
Comments
This is likely a sveltekit issue. Glide works perfectly fine when imported by a JavaScript module and bundled using browserify or rollup. |
The issue is gone once I imported glide like this
But still, I'm curious to know why it happens with sveltekit when it's imported like this |
Also replicable in remix |
I ran into the same problem using Qwik framework. Here is how I solved it. ProblemUsing the documented import like import Glide from "@glidejs/glide" Results in the error AnalysisI noted that the file imported with the above import SolutionUse alternate import from import Glide from "@glidejs/glide/dist/glide.esm"; If you go to the source of the above file you can see the last line Then you must use your frameworks client side execution model to run the ctor. For Qwik this was to use the hook export const CustomSlider = component$<CustomSliderProps>(({ images }) => {
useOnWindow(
"load",
$(() => {
var glide = new Glide(".glide");
glide.mount();
}),
);
.... I hope this helps NOTE TS will still complain if you are using TS just mock the types by using the |
I'm using glidejs with sveltekit. It's working perfectly fine in my localhost, but after deployment, I'm getting this error
<script> ... import Glide from '@glidejs/glide'; //getting the error here on the deployment server only ... </script>
This is how I'm referencing glide.core.min.css
<svelte:head> <link rel="stylesheet" href="../node_modules/@glidejs/glide/dist/css/glide.core.min.css" /> </svelte:head>
The text was updated successfully, but these errors were encountered: