Skip to content

Conversation

FTWinston
Copy link

@FTWinston FTWinston commented May 27, 2020

The type definitions indicate that JSONPatcherProxy is a default export, but it isn't. It's a named export, so this PR just changes the type definition file to account for this.

Without this change, in typescript this shows no error:
import JSONPatcherProxy from 'jsonpatcherproxy';
but at runtime I get:
TypeError: jsonpatcherproxy_1.default is not a constructor

And if I try to use a named import:
import { JSONPatcherProxy } from 'jsonpatcherproxy';
I get a "has no exported member 'JSONPatcherProxy'" error.

With this change, the named imports satisfy typescript and work at runtime.

@FTWinston
Copy link
Author

Regarding the failed CI, the master branch is failing with the same error currently :)

@FTWinston FTWinston changed the title Corrected glitch with type definitions Correct glitch with type definitions May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant