Skip to content
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

Gulp.js issue: Cannot set property 'lozad' of undefined #261

Open
olehhladkov-p opened this issue Feb 5, 2021 · 0 comments
Open

Gulp.js issue: Cannot set property 'lozad' of undefined #261

olehhladkov-p opened this issue Feb 5, 2021 · 0 comments

Comments

@olehhladkov-p
Copy link

Hi, thanks for the cool library!
Recently faced an unobvious problem

Current Behavior

When adding a library using gulp.js (concatenate many scripts into one file), I get the error Cannot set property 'lozad' of undefined, the error was in this line of code (global.lozad = factory()); global was undefined
although when loading via cdn - there are no errors

Possible Solution

I added a simple check (global = global || self, global.lozad = factory()); and everything worked as expected

Please pay attention

P.S. You've got a cool tool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant