ApoorvSaxena / ApoorvSaxena/lozad.js

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

オープン
#261 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
7.5k
フォーク
435
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。