Skip to content

JSDom 11.12 causes SecurityError: localStorage is not available for opaque origins #6766

Closed
@csvan

Description

@csvan

🐛 Bug Report

A clear and concise description of what the bug is.

Jsdom just recently upgraded to version 11.12, which includes support for window.localStorage and other features. See https://github.com/jsdom/jsdom/blob/master/Changelog.md.

A fresh yarn install deduces that Jest uses this latest version, but this causes all existing Jest test cases to fail with:

SecurityError: localStorage is not available for opaque origins

To Reproduce

Steps to reproduce the behavior:

  1. Install latest Jest
  2. Make a clean yarn/npm install
  3. Setup a basic test case
  4. Run it

Expected behavior

Test case should pass.

Run npx envinfo --preset jest

Paste the results here:

  System:
    OS: Linux 4.15
    CPU: x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
  Binaries:
    Node: 10.7.0
    Yarn: 1.7.0
    npm: 6.1.0
  npmPackages:
    jest:
      wanted: ~23.4.0
      installed: 23.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions