Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/odd-cups-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@preact/async-loader': patch
---

Fix for possible type error in `async-loader`
4 changes: 2 additions & 2 deletions packages/async-loader/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const PENDING = {};
// Given a VNode, finds its previous element sibling
function getPreviousSibling(vnode, inner) {
// in an element parent with no preceeding siblings means we're the first child
if (typeof vnode.type === 'string') return null;
if (!vnode || typeof vnode.type === 'string') return null;
const parent = vnode.__;
if (!parent) return;
let children = parent.__k;
Expand All @@ -16,7 +16,7 @@ function getPreviousSibling(vnode, inner) {
if (end === -1) end = children.length;
for (let i = end; i--; ) {
const child = children[i];
const dom = (child && child.__e) || getPreviousSibling(child, true);
const dom = child && (child.__e || getPreviousSibling(child, true));
if (dom) return dom;
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/tests/images/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ exports.default = Object.assign({}, common, {
'ssr-build/ssr-bundle.js.map': 52686,
'ssr-build/asset-manifest.json': 178,
'bundle.259c5.css': 901,
'bundle.f79fb.js': 21429,
'bundle.f79fb.js.map': 111801,
'bundle.85124.js': 21429,
'bundle.85124.js.map': 111801,
'favicon.ico': 15086,
'index.html': 2034,
'manifest.json': 455,
Expand Down