8000 Node12+ import documentation incorrect · Issue #311 · Starcounter-Jack/JSON-Patch · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Node12+ import documentation incorrect #311
Open
@rcollette

Description

@rcollette

When importing in Node12+ with ECMAScript module support enabled

import * as jsonpatch from "fast-json-patch";

You won't get a compile-time error from Typescript, but you will get a runtime error when calling something like jsonpatch.applyPatch stating that the method does not exist.

Because it is defined as a default export, it should be imported like:

import jsonPatch from "fast-json-patch"

Note that I changed the casing as well so that the IDE doesn't complain about spelling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0