Skip to content

Commit a47c410

Browse files
committed
fix: state could have no children
Fix #36
1 parent a8650db commit a47c410

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

src/loadComponents.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function loadComponents() {
5050
}
5151

5252
const state = window[LOADABLE_STATE]
53-
if (!state || !state.children) {
53+
if (!state) {
5454
throw new Error(
5555
'loadable-components state not found. ' +
5656
'You have a problem server-side. ' +

src/loadComponents.test.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,4 @@ describe('loadComponents', () => {
4141
expect(err.message).toMatch(/loadable-components state not found/)
4242
}
4343
})
44-
45-
it('should handle no children', async () => {
46-
delete window[LOADABLE_STATE].children
47-
expect.assertions(1)
48-
49-
try {
50-
await loadComponents()
51-
} catch (err) {
52-
expect(err.message).toMatch(/loadable-components state not found/)
53-
}
54-
})
5544
})

0 commit comments

Comments
 (0)