Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Type inference for dayjs.utc #110

Closed
luciorubeens opened this issue May 1, 2020 · 0 comments · Fixed by #191
Closed

Type inference for dayjs.utc #110

luciorubeens opened this issue May 1, 2020 · 0 comments · Fixed by #191
Labels
Type: Bug The issue relates to broken or incorrect behaviour.

Comments

@luciorubeens
Copy link
Contributor

Got an error when using this library in a TypeScript project:

Current Behavior

ERROR in node_modules/@arkecosystem/platform-sdk/dist/utils/dayjs.d.ts:2:40 - error TS2339: Property 'utc' does not exist on type 'typeof dayjs'.

2 export declare const dayjs: typeof day.utc;

The TS compiler does not handle the prototype change by the plugin:
https://unpkg.com/browse/@arkecosystem/platform-sdk@0.3.6/dist/utils/dayjs.d.ts

Possible Solution

Importing the type explicitly in tsconfig.json solved it on the client:

{
	"extends": "./tsconfig.json",
	"include": [
		"node_modules/dayjs/plugin/utc.d.ts"
	]
}
@faustbrian faustbrian added the Type: Bug The issue relates to broken or incorrect behaviour. label May 1, 2020
@faustbrian faustbrian added this to the 1.0.0 milestone May 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug The issue relates to broken or incorrect behaviour.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants