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

fix(plugin-vue): Access the window object safely, in case it isn't defined #928

Merged
merged 3 commits into from
Jul 15, 2020

Conversation

imjoehaines
Copy link
Member

This prevents errors when using SSR as window won't exist

The tests for this aren't particularly nice as we have to edit the global object to add/remove references to window and window.Vue; I'm not sure there's a nicer way to write them ?

Fixes #895

This prevents errors when using SSR as 'window' won't exist
@bugsnagbot
Copy link
Collaborator

bugsnagbot commented Jul 13, 2020

@bugsnag/browser bundle size diff

Minified Minfied + Gzipped
Before 39.56 kB 12.22 kB
After 39.56 kB 12.22 kB
± No change No change

Generated by 🚫 dangerJS against aa887ea

Copy link
Contributor

@bengourley bengourley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that tests seem pretty nasty, but I can't think of a better way to do them.

@bengourley bengourley merged commit d655dc0 into next Jul 15, 2020
@bengourley bengourley deleted the safe-window-reference-vue-plugin branch July 15, 2020 20:28
@djskinner djskinner mentioned this pull request Jul 22, 2020
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

Successfully merging this pull request may close these issues.

@bugsnag/plugin-vue not working in ssr
4 participants