type check not pass
See original GitHub issueDescribe/explain the bug When I run tsc in my project,it show the error that
node_modules/@nivo/core/index.d.ts:2:10 - error TS2305: Module '"react-spring"' has no exported member 'OpaqueInterpolation'.
2 import { OpaqueInterpolation, SpringConfig } from 'react-spring'
~~~~~~~~~~~~~~~~~~~
node_modules/@nivo/core/index.d.ts:252:12 - error TS1038: A 'declare' modifier cannot be used in an already ambient context.
252 export declare const defaultAnimate = true
~~~~~~~
node_modules/@nivo/core/index.d.ts:253:12 - error TS1038: A 'declare' modifier cannot be used in an already ambient context.
253 export declare const defaultMotionStiffness = 90
~~~~~~~
node_modules/@nivo/core/index.d.ts:254:12 - error TS1038: A 'declare' modifier cannot be used in an already ambient context.
254 export declare const defaultMotionDamping = 15
~~~~~~~
node_modules/@nivo/core/index.d.ts:256:12 - error TS1038: A 'declare' modifier cannot be used in an already ambient context.
256 export declare const motionDefaultProps = {
~~~~~~~
node_modules/@nivo/core/index.d.ts:256:47 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.
256 export declare const motionDefaultProps = {
~
257 animate: true,
~~~~~~~~~~~~~~~~~~~~~~
...
260 config: 'default',
~~~~~~~~~~~~~~~~~~~~~~~~~~
261 }
~~~~~
node_modules/@nivo/core/index.d.ts:263:12 - error TS1038: A 'declare' modifier cannot be used in an already ambient context.
263 export declare const defaultMargin = {
~~~~~~~
node_modules/@nivo/core/index.d.ts:263:42 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.
263 export declare const defaultMargin = {
~
264 top: 0,
~~~~~~~~~~~~~~~
...
267 left: 0,
~~~~~~~~~~~~~~~~
268 }
~~~~~
node_modules/@nivo/core/index.d.ts:291:31 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.
291 export const SvgWrapper = (
~
292 props: React.PropsWithChildren<{
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
298 }>
~~~~~~~~~~
299 ) => JSX.Element
~~~~~~~~~~~~~~~~~~~~
node_modules/@nivo/core/index.d.ts:299:10 - error TS2708: Cannot use namespace 'JSX' as a value.
299 ) => JSX.Element
~~~
node_modules/@nivo/core/index.d.ts:311:30 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.
311 export const Container = (props: React.PropsWithChildren<ContainerProps>) => JSX.Element
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@nivo/core/index.d.ts:311:82 - error TS2708: Cannot use namespace 'JSX' as a value.
311 export const Container = (props: React.PropsWithChildren<ContainerProps>) => JSX.Element
~~~
node_modules/@nivo/core/index.d.ts:313:38 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.
313 export const ResponsiveWrapper = (props: {
~~~~~~~~~
314 children: (dimensions: { width: number; height: number }) => JSX.Element
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
315 }) => JSX.Element
~~~~~~~~~~~~~~~~~~~~~
node_modules/@nivo/core/index.d.ts:315:11 - error TS2708: Cannot use namespace 'JSX' as a value.
315 }) => JSX.Element
~~~
Found 14 errors.
To Reproduce
Steps to reproduce the behavior:
- create a vite project
- install
@nivo/calendar
and@nivo/core
- import
@nivo/calendar
- run
tsc
Expected behavior no error
Screenshots
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
TypeScript function passes type check when not expected to
The line identityOrCall(() => 'x') appears to pass the compiler's type checking. Why? Shouldn't it give an error? If identityOrCall is passed a ......
Read more >Type checking stops after spread operator #47995 - GitHub
Type mismatch is missed after use of spread operator. Expected behavior. I expect a "Type 'number' is not assignable to type 'string | ......
Read more >Documentation - Narrowing - TypeScript
Checking whether the kind property was "circle" got rid of every type in Shape that didn't have a kind property with the type...
Read more >Methods for TypeScript runtime type checking - LogRocket Blog
Explore five methods of performing TypeScript type checks at runtime in this post and learn each of their advantages and disadvantages.
Read more >Common issues and solutions - mypy 0.991 documentation
Functions that do not have any annotations (neither for any argument nor for the return type) are not type-checked, and even the most...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is fixed in the latest version.
My
/s
was meant to denote sarcasm…I also notice that
react-spring
was recently updated tov9.0.0
and moved out of release candidate stage. A PR for that change in this library should also be created. If I get time, I will do that.