-
Notifications
You must be signed in to change notification settings - Fork 353
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-babel : Cannot set property 'svg4everybody' of undefined for root #162
Comments
i have this issue as well using babel and webpack, because the lib tries to assign |
this could be fixed by assigning |
@stephanepericat See #111 |
Same here for a normal gulp build. |
Solution: define root for browsers
|
This one configuration of babel worked for me. {
"presets": [ [ "es2015", { modules: false } ] ]
} |
This would change it for your whole bundle. |
See #171 |
I have this same issue. Is there any news for a new release @jonathantneal ? |
Still running into this issue. Anyone find a workaround? |
Hello everyone,
After adding gulp-babel to my JS tasks, svg4everybody started to display this error in the console :
Uncaught TypeError: Cannot set property 'svg4everybody' of undefined
It looks like root refers to undefined when in strict mode (automatically added by gulp-babel). This line is causing the problems (line 10 but other parts of the script are affected) :
"object" == typeof module && module.exports ? module.exports = factory() : root.svg4everybody = factory();
My workaround to make it work was to exclude the file from gulp tasks and include it manually in the document. Is there any fix for this issue ? Does anyone found a workaround for it (not overkill) ?
The text was updated successfully, but these errors were encountered: