Skip to content

Commit

Permalink
Dont throw on error, but log error
Browse files Browse the repository at this point in the history
  • Loading branch information
damassi committed May 23, 2018
1 parent 5f25f44 commit c1439fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/loadComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function loadState(rootState) {
'loadable-component server modules:',
window[LOADABLE_STATE],
)
throw new Error(
console.error(
`loadable-components: module "${
state.id
}" is not found, client and server modules are not sync. You are probably not using the same resolver on server and client.`,
Expand All @@ -28,7 +28,7 @@ function loadState(rootState) {
const getLoadable = component[LOADABLE]

if (typeof getLoadable !== 'function') {
throw new Error(
console.error(
`loadable-components: module "${
state.id
}" is not a loadable component, please verify your SSR setup`,
Expand All @@ -44,14 +44,14 @@ function loadState(rootState) {

function loadComponents() {
if (typeof window === 'undefined') {
throw new Error(
console.error(
'loadable-components: `loadComponents` must be called client-side: `window` is undefined',
)
}

const state = window[LOADABLE_STATE]
if (!state) {
throw new Error(
console.error(
'loadable-components state not found. ' +
'You have a problem server-side. ' +
'Please verify that you have called `loadableState.getScriptTag()` server-side.',
Expand Down

0 comments on commit c1439fd

Please sign in to comment.