Skip to content

"Unexpected token ." errors from ?. operator on modern runtimes #130

@TJC

Description

@TJC

I wondered if anyone else is seeing client-side errors coming in related to the ?. operator at https://github.com/ulid/javascript/blob/master/source/ulid.ts#L51

It manifests as Unexpected token . with the stack trace pointing to node_modules/ulid/dist/browser/index.js:158 -- which holds:

if (typeof globalCrypto?.getRandomValues === "function") {

Our error-tracking reports modern browser versions, where the ?. operator has existed for many years.

Since I'm at a bit of a loss here, I thought I'd create an issue here in case others are seeing this. Maybe we can work something out?

ulid versions we've seen the issue on: 3.0.0 and 3.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions