-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
[next.180] Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'target.querySelector') #12390
Comments
Does this happen in earlier versions as well or did it start with 180? |
next.179 did not have this specific issue for me. More precisely, I had a similar issue with next.179 when hmr was enabled, but it didn't affect me after I turned it off. Now, i have this issue regardless of whether hmr is enabled. |
Just updated to .182 and started seeing the same thing, this is the block of code it fails on: // node_modules/.pnpm/[email protected]/node_modules/svelte/src/internal/client/dom/css.js
var seen = /* @__PURE__ */ new Set();
function append_styles(anchor, css) {
if (!DEV) {
if (seen.has(css)) return;
seen.add(css);
}
queue_micro_task(() => {
var root = anchor.getRootNode();
var target = (
/** @type {ShadowRoot} */
root.host ? (
/** @type {ShadowRoot} */
root
) : (
/** @type {Document} */
root.head
)
);
if (!target.querySelector("#" css.hash)) { // <--- HERE
const style = document.createElement("style");
style.id = css.hash;
style.textContent = css.code;
target.appendChild(style);
}
});
} Also works if rolled back to .179 |
Should be fixed in the latest version. |
Describe the bug
Apologies in advance for the suboptimal repro, just started noticing this error and rendering issue when doing a client-side navigate to a page that renders
<Select>
from thesvelte-select
lib (ships its own CSS). When doing an SSR while on the target page, there is no error, so it appears to only happen when doing a client-side navigate from a page that doesn't render<Select>
to a page that does.Reproduction
Logs
No response
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: