Kenny King
Kenny King

Reputation: 33

Uncaught TypeError: Glide is not a constructor - Using Glide.js with Laravel

I have Glide.js installed on Laravel 8. I was using the CDN to test it out and everything was working fine. When I installed it with NPM, I get this:

Uncaught TypeError: Glide is not a constructor

This is how I have it in bootstrap.js:

window.Glide = require('@glidejs/glide');

The Javascript is complied fine into app.js. I just can't figure out why it's showing that error. Any help would be appreciated, thanks!

Upvotes: 0

Views: 913

Answers (1)

Kenny Horna
Kenny Horna

Reputation: 14271

Try it like this:

import Glide from '@glidejs/glide';
window.Glide = Glide;

Upvotes: 1

Related Questions