Skip to content

[TEST] OutletView.appendTo renders into a selector string when hasDOM is false - #44

Open
johanrd wants to merge 1 commit into
mainfrom
test/string-root-element-without-dom
Open

johanrd wants to merge 1 commit into
mainfrom
test/string-root-element-without-dom

Conversation

@johanrd

@johanrd johanrd commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Failing test, no fix.

With isBrowser: false, OutletView.appendTo hands a string rootElement straight to the element builder, which fails on the first insert with TypeError: parent.insertBefore is not a function. Component.appendTo asserts in this case; the test expects the same assertion.

In production we see this (e.insertBefore in minified builds) from browsers whose global fails one of the identity checks in has-dom.ts, so isBrowser defaults to false while rootElement is still the default 'body' selector. Context: emberjs/rfcs#1178 and emberjs#21348 would remove the hasDOM split.

steps to repro faling test

  1. pnpm start
  2. visit http://localhost:5173/?filter=isBrowser
Screenshot 2026-09-16 at 11 48 07

@johanrd
johanrd force-pushed the test/string-root-element-without-dom branch from 90df45a to bc67e14 Compare September 16, 2026 08:58
@johanrd johanrd changed the title [TEST] String rootElement is not resolved when hasDOM is false [TEST] hasDOM sniff fails when the global is redefined; string rootElement reaches the element builder Sep 16, 2026
@johanrd
johanrd force-pushed the test/string-root-element-without-dom branch 2 times, most recently from cbf5037 to 3afca11 Compare September 16, 2026 09:05
… is false

With isBrowser: false, OutletView.appendTo hands a string rootElement
straight to the element builder, which fails on the first insert with
`TypeError: parent.insertBefore is not a function`. Component.appendTo
asserts in this case; this test expects the same assertion.

In production this happens in browsers whose global fails one of the
identity checks in has-dom.ts, so isBrowser defaults to false while the
rootElement is still the default 'body' selector.

Cowritten by Claude
@johanrd
johanrd force-pushed the test/string-root-element-without-dom branch from 3afca11 to b6eac5d Compare September 16, 2026 09:39
@johanrd johanrd changed the title [TEST] hasDOM sniff fails when the global is redefined; string rootElement reaches the element builder [TEST] OutletView.appendTo renders into a selector string when hasDOM is false Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant