Skip to content

Accessing localStorage fails #18

Closed
@carson-katri

Description

@carson-katri

Here's a simple example:

let localStorage = JSObjectRef.global.localStorage.object!
print(localStorage.getItem!("hello"))
_ = localStorage.setItem!("hello", "world")
print(localStorage.getItem!("hello"))

Prints null then .string("world") as expected.

However, if you refresh the site after the value is set, it crashes with Reflect.get called on non-object.

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