Skip to content

Random crashes when closing the browser with bun runtime #1800

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

Open
garysassano opened this issue Apr 11, 2025 · 0 comments
Open

Random crashes when closing the browser with bun runtime #1800

garysassano opened this issue Apr 11, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@garysassano
Copy link

For some reason, after visiting certain pages, happy-dom crashes when attempting to close the browser. Strangely, this issue only occurs with Bun, as I couldn't replicate it when using Node.js with the same pages.

index.ts

import { Browser } from "happy-dom";

const browser = new Browser();
const page = browser.newPage();

try {
  const url = "https://www.example.com/";
  console.log(`Navigating to ${url}...`);
  await page.goto(url);

  const cookies = await page.context.cookieContainer.getCookies(new URL(url));
  console.log("\n--- Cookies ---");
  console.log(JSON.stringify(cookies, null, 2));
  console.log("---------------");
} catch (error) {
  console.error("Error occurred:", error);
} finally {
  console.log("\nClosing browser...");
  await browser.close();
  console.log("Browser closed.");
}
Crash run
Navigating to https://www.amazon.it/dp/B00LH3DMUO...

--- Cookies ---
[
  {
    "key": "i18n-prefs",
    "originURL": "https://www.amazon.it/dp/B00LH3DMUO",
    "value": "EUR",
    "domain": ".amazon.it",
    "path": "/",
    "expires": "2026-04-11T00:56:09.000Z",
    "httpOnly": false,
    "secure": false,
    "sameSite": "Lax"
  }
]
---------------

Closing browser...
Browser closed.
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
TypeError: null is not an object (evaluating 'browserFrame.page')
      at /home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33
283 |      * @param url URL.
284 |      */
285 |     async #preloadResource(url) {
286 |         const window = this[PropertySymbol.window];
287 |         const browserFrame = new WindowBrowserContext(window).getBrowserFrame();
288 |         const browserSettings = browserFrame.page?.context?.browser?.settings;
                                      ^
TypeError: null is not an object (evaluating 'browserFrame.page')
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33)
      at #preloadResource (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:285:28)
      at [onSetAttribute] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:241:30)
      at [setNamedItem] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/element/NamedNodeMap.js:179:62)
      at parseEndOfStartTag (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:346:51)
      at parse (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:206:34)
      at write (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/document/Document.js:1227:16)
      at content (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/BrowserFrame.js:62:30)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/utilities/BrowserFrameNavigator.js:188:17)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/window/BrowserWindow.js:1236:30)
283 |      * @param url URL.
284 |      */
285 |     async #preloadResource(url) {
286 |         const window = this[PropertySymbol.window];
287 |         const browserFrame = new WindowBrowserContext(window).getBrowserFrame();
288 |         const browserSettings = browserFrame.page?.context?.browser?.settings;
                                      ^
TypeError: null is not an object (evaluating 'browserFrame.page')
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33)
      at #preloadResource (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:285:28)
      at [onSetAttribute] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:241:30)
      at [setNamedItem] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/element/NamedNodeMap.js:179:62)
      at parseEndOfStartTag (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:346:51)
      at parse (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:206:34)
      at write (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/document/Document.js:1227:16)
      at content (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/BrowserFrame.js:62:30)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/utilities/BrowserFrameNavigator.js:188:17)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/window/BrowserWindow.js:1236:30)
283 |      * @param url URL.
284 |      */
285 |     async #preloadResource(url) {
286 |         const window = this[PropertySymbol.window];
287 |         const browserFrame = new WindowBrowserContext(window).getBrowserFrame();
288 |         const browserSettings = browserFrame.page?.context?.browser?.settings;
                                      ^
TypeError: null is not an object (evaluating 'browserFrame.page')
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33)
      at #preloadResource (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:285:28)
      at [onSetAttribute] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:241:30)
      at [setNamedItem] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/element/NamedNodeMap.js:179:62)
      at parseEndOfStartTag (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:346:51)
      at parse (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:206:34)
      at write (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/document/Document.js:1227:16)
      at content (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/BrowserFrame.js:62:30)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/utilities/BrowserFrameNavigator.js:188:17)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/window/BrowserWindow.js:1236:30)
283 |      * @param url URL.
284 |      */
285 |     async #preloadResource(url) {
286 |         const window = this[PropertySymbol.window];
287 |         const browserFrame = new WindowBrowserContext(window).getBrowserFrame();
288 |         const browserSettings = browserFrame.page?.context?.browser?.settings;
                                      ^
TypeError: null is not an object (evaluating 'browserFrame.page')
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33)
      at #preloadResource (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:285:28)
      at [onSetAttribute] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:241:30)
      at [setNamedItem] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/element/NamedNodeMap.js:179:62)
      at parseEndOfStartTag (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:346:51)
      at parse (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:206:34)
      at write (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/document/Document.js:1227:16)
      at content (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/BrowserFrame.js:62:30)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/utilities/BrowserFrameNavigator.js:188:17)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/window/BrowserWindow.js:1236:30)
283 |      * @param url URL.
284 |      */
285 |     async #preloadResource(url) {
286 |         const window = this[PropertySymbol.window];
287 |         const browserFrame = new WindowBrowserContext(window).getBrowserFrame();
288 |         const browserSettings = browserFrame.page?.context?.browser?.settings;
                                      ^
TypeError: null is not an object (evaluating 'browserFrame.page')
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33)
      at #preloadResource (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:285:28)
      at [onSetAttribute] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:241:30)
      at [setNamedItem] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/element/NamedNodeMap.js:179:62)
      at parseEndOfStartTag (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:346:51)
      at parse (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:206:34)
      at write (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/document/Document.js:1227:16)
      at content (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/BrowserFrame.js:62:30)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/utilities/BrowserFrameNavigator.js:188:17)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/window/BrowserWindow.js:1236:30)
283 |      * @param url URL.
284 |      */
285 |     async #preloadResource(url) {
286 |         const window = this[PropertySymbol.window];
287 |         const browserFrame = new WindowBrowserContext(window).getBrowserFrame();
288 |         const browserSettings = browserFrame.page?.context?.browser?.settings;
                                      ^
TypeError: null is not an object (evaluating 'browserFrame.page')
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33)
      at #preloadResource (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:285:28)
      at [onSetAttribute] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:241:30)
      at [setNamedItem] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/element/NamedNodeMap.js:179:62)
      at parseEndOfStartTag (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:346:51)
      at parse (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:206:34)
      at write (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/document/Document.js:1227:16)
      at content (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/BrowserFrame.js:62:30)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/utilities/BrowserFrameNavigator.js:188:17)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/window/BrowserWindow.js:1236:30)
283 |      * @param url URL.
284 |      */
285 |     async #preloadResource(url) {
286 |         const window = this[PropertySymbol.window];
287 |         const browserFrame = new WindowBrowserContext(window).getBrowserFrame();
288 |         const browserSettings = browserFrame.page?.context?.browser?.settings;
                                      ^
TypeError: null is not an object (evaluating 'browserFrame.page')
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33)
      at #preloadResource (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:285:28)
      at [onSetAttribute] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:241:30)
      at [setNamedItem] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/element/NamedNodeMap.js:179:62)
      at parseEndOfStartTag (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:346:51)
      at parse (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:206:34)
      at write (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/document/Document.js:1227:16)
      at content (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/BrowserFrame.js:62:30)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/utilities/BrowserFrameNavigator.js:188:17)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/window/BrowserWindow.js:1236:30)
283 |      * @param url URL.
284 |      */
285 |     async #preloadResource(url) {
286 |         const window = this[PropertySymbol.window];
287 |         const browserFrame = new WindowBrowserContext(window).getBrowserFrame();
288 |         const browserSettings = browserFrame.page?.context?.browser?.settings;
                                      ^
TypeError: null is not an object (evaluating 'browserFrame.page')
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33)
      at #preloadResource (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:285:28)
      at [onSetAttribute] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:241:30)
      at [setNamedItem] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/element/NamedNodeMap.js:179:62)
      at parseEndOfStartTag (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:346:51)
      at parse (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:206:34)
      at write (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/document/Document.js:1227:16)
      at content (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/BrowserFrame.js:62:30)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/utilities/BrowserFrameNavigator.js:188:17)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/window/BrowserWindow.js:1236:30)
283 |      * @param url URL.
284 |      */
285 |     async #preloadResource(url) {
286 |         const window = this[PropertySymbol.window];
287 |         const browserFrame = new WindowBrowserContext(window).getBrowserFrame();
288 |         const browserSettings = browserFrame.page?.context?.browser?.settings;
                                      ^
TypeError: null is not an object (evaluating 'browserFrame.page')
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33)
      at #preloadResource (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:285:28)
      at [onSetAttribute] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:241:30)
      at [setNamedItem] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/element/NamedNodeMap.js:179:62)
      at parseEndOfStartTag (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:346:51)
      at parse (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:206:34)
      at write (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/document/Document.js:1227:16)
      at content (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/BrowserFrame.js:62:30)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/utilities/BrowserFrameNavigator.js:188:17)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/window/BrowserWindow.js:1236:30)
283 |      * @param url URL.
284 |      */
285 |     async #preloadResource(url) {
286 |         const window = this[PropertySymbol.window];
287 |         const browserFrame = new WindowBrowserContext(window).getBrowserFrame();
288 |         const browserSettings = browserFrame.page?.context?.browser?.settings;
                                      ^
TypeError: null is not an object (evaluating 'browserFrame.page')
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33)
      at #preloadResource (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:285:28)
      at [onSetAttribute] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:241:30)
      at [setNamedItem] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/element/NamedNodeMap.js:179:62)
      at parseEndOfStartTag (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:346:51)
      at parse (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:206:34)
      at write (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/document/Document.js:1227:16)
      at content (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/BrowserFrame.js:62:30)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/utilities/BrowserFrameNavigator.js:188:17)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/window/BrowserWindow.js:1236:30)
283 |      * @param url URL.
284 |      */
285 |     async #preloadResource(url) {
286 |         const window = this[PropertySymbol.window];
287 |         const browserFrame = new WindowBrowserContext(window).getBrowserFrame();
288 |         const browserSettings = browserFrame.page?.context?.browser?.settings;
                                      ^
TypeError: null is not an object (evaluating 'browserFrame.page')
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33)
      at #preloadResource (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:285:28)
      at [onSetAttribute] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:241:30)
      at [setNamedItem] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/element/NamedNodeMap.js:179:62)
      at parseEndOfStartTag (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:346:51)
      at parse (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:206:34)
      at write (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/document/Document.js:1227:16)
      at content (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/BrowserFrame.js:62:30)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/utilities/BrowserFrameNavigator.js:188:17)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/window/BrowserWindow.js:1236:30)
283 |      * @param url URL.
284 |      */
285 |     async #preloadResource(url) {
286 |         const window = this[PropertySymbol.window];
287 |         const browserFrame = new WindowBrowserContext(window).getBrowserFrame();
288 |         const browserSettings = browserFrame.page?.context?.browser?.settings;
                                      ^
TypeError: null is not an object (evaluating 'browserFrame.page')
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33)
      at #preloadResource (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:285:28)
      at [onSetAttribute] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:241:30)
      at [setNamedItem] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/element/NamedNodeMap.js:179:62)
      at parseEndOfStartTag (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:346:51)
      at parse (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:206:34)
      at write (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/document/Document.js:1227:16)
      at content (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/BrowserFrame.js:62:30)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/utilities/BrowserFrameNavigator.js:188:17)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/window/BrowserWindow.js:1236:30)
283 |      * @param url URL.
284 |      */
285 |     async #preloadResource(url) {
286 |         const window = this[PropertySymbol.window];
287 |         const browserFrame = new WindowBrowserContext(window).getBrowserFrame();
288 |         const browserSettings = browserFrame.page?.context?.browser?.settings;
                                      ^
TypeError: null is not an object (evaluating 'browserFrame.page')
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33)
      at #preloadResource (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:285:28)
      at [onSetAttribute] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:241:30)
      at [setNamedItem] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/element/NamedNodeMap.js:179:62)
      at parseEndOfStartTag (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:346:51)
      at parse (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:206:34)
      at write (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/document/Document.js:1227:16)
      at content (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/BrowserFrame.js:62:30)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/utilities/BrowserFrameNavigator.js:188:17)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/window/BrowserWindow.js:1236:30)
283 |      * @param url URL.
284 |      */
285 |     async #preloadResource(url) {
286 |         const window = this[PropertySymbol.window];
287 |         const browserFrame = new WindowBrowserContext(window).getBrowserFrame();
288 |         const browserSettings = browserFrame.page?.context?.browser?.settings;
                                      ^
TypeError: null is not an object (evaluating 'browserFrame.page')
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33)
      at #preloadResource (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:285:28)
      at [onSetAttribute] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:241:30)
      at [setNamedItem] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/element/NamedNodeMap.js:179:62)
      at parseEndOfStartTag (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:346:51)
      at parse (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:206:34)
      at write (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/document/Document.js:1227:16)
      at content (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/BrowserFrame.js:62:30)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/utilities/BrowserFrameNavigator.js:188:17)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/window/BrowserWindow.js:1236:30)
283 |      * @param url URL.
284 |      */
285 |     async #preloadResource(url) {
286 |         const window = this[PropertySymbol.window];
287 |         const browserFrame = new WindowBrowserContext(window).getBrowserFrame();
288 |         const browserSettings = browserFrame.page?.context?.browser?.settings;
                                      ^
TypeError: null is not an object (evaluating 'browserFrame.page')
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:288:33)
      at #preloadResource (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:285:28)
      at [onSetAttribute] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/html-link-element/HTMLLinkElement.js:241:30)
      at [setNamedItem] (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/element/NamedNodeMap.js:179:62)
      at parseEndOfStartTag (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:346:51)
      at parse (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/html-parser/HTMLParser.js:206:34)
      at write (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/nodes/document/Document.js:1227:16)
      at content (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/BrowserFrame.js:62:30)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/browser/utilities/BrowserFrameNavigator.js:188:17)
      at <anonymous> (/home/user/github/bun-happy-dom/node_modules/happy-dom/lib/window/BrowserWindow.js:1236:30)

Bun v1.2.9 (Linux x64 baseline)
@garysassano garysassano added the bug Something isn't working label Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant