Skip to content

Commit

Permalink
fix: prevent window.onNuxtReady is undefined exception
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Aug 2, 2020
1 parent 4f33618 commit a7c9dc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<%= options.styles.map(s => `import '${s}'`).join("\n") %>
<% } %>
import Vue from 'vue'
import { normalizeError } from '~~/.nuxt-storybook/utils'
import '~storybook/mock'
<% if (options.store) { %>import { createStore } from '~~/.nuxt-storybook/store'<% } %>
<% if (options.components) { %>import * as components from '~~/.nuxt-storybook/components';
Expand All @@ -11,7 +12,6 @@ Object.keys(components).forEach(name => Vue.component(name, components[name]))<%
<% }) %>



const inject = (name, impl) => {
Vue.prototype['$' + name] = impl
}
Expand All @@ -22,7 +22,7 @@ Vue.prototype.app = {};<% /* prevent undefined app exception */ %>
try {
plugin(Vue.prototype, inject)
} catch (e) {
console.warn(e)<% /* warn plugin error */ %>
console.error(normalizeError(e))<% /* warn plugin error */ %>
}
}
})
Expand Down

0 comments on commit a7c9dc5

Please sign in to comment.