1

I have a svelte website & I'm using glidejs. Everything is working fine on my localhost, but once I deployed, I'm getting this error. I'm using node server adapter

SyntaxError: The requested module '@glidejs/glide' does not provide an export named 'default'

at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)

at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)

I'm importing glide correctly -it's working on localhost-

import Glide from '@glidejs/glide'; 

What could be the reason & how to fix it?

The issue happened on render.com & a2hosting.com

2
  • What version of Node.js have you configured Render.com to use when executing your code? Commented Oct 2, 2023 at 20:17
  • @esqew 18.18.0 "lts" Commented Oct 2, 2023 at 22:02

2 Answers 2

0

I'm using Glide with nuxt3 and has the same error, but as workaround I found that some, trick works for me:

import * as Glide from "@glidejs/glide"; 

then

new Glide.default(".glide", options).mount(); 

or just use another import:

import Glide from '@glidejs/glide/dist/glide.esm' 
Sign up to request clarification or add additional context in comments.

Comments

0

The issue is gone once I imported glide like this

<svelte:head> <script src="node_modules/@glidejs/glide/dist/glide.min.js"></script> <link rel="stylesheet" href="../node_modules/@glidejs/glide/dist/css/glide.core.min.css" /> </svelte:head> 

But still, I'm curious to know why it happens with sveltekit when it's imported like this

import Glide from '@glidejs/glide'; 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.