Is anyone able to assist with resolving the problem of `tsc` constantly monitoring `node_modules`?

Using the Expo platform has been a great experience for me. Here is a snippet from my tsconfig.json:

{
    "compilerOptions": {
        "paths": {
            "@/*": [
                "./src/*"
            ],
            "@assets/*": [
                "./assets/*"
            ]
        },
        "strict": true,
        "strictFunctionTypes": false,
        "noFallthroughCasesInSwitch": true
    },
    "include": [
        "src",
        ".expo/types/**/*.ts",
        "expo-env.d.ts"
    ],
    "extends": "expo/tsconfig.base"
}

It's worth noting that this configuration extends expo/tsconfig.base:

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "Expo",

  "compilerOptions": {
    "allowJs": true,
    "esModuleInterop": true,
    "jsx": "react-native",
    "lib": ["DOM", "ESNext"],
    "moduleResolution": "node",
    "noEmit": true,
    "resolveJsonModule": true,
    "skipLibCheck": true,
    "target": "ESNext"
  },

  "exclude": ["node_modules", "babel.config.js", "metro.config.js", "jest.config.js"]
}

Despite this, I've encountered an issue where tsc seems to be tracking node_modules. I've searched for solutions but haven't found any yet.

$ yarn tsc

...

Errors  Files
     1  node_modules/react-native-gifted-charts/src/BarChart/Animated2DWithGradient.tsx:110
     8  node_modules/react-native-gifted-charts/src/BarChart/index.tsx:19
     3  node_modules/react-native-gifted-charts/src/BarChart/RenderBars.tsx:219
     1  node_modules/react-native-gifted-charts/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/index.tsx:8
     3  node_modules/react-native-gifted-charts/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderDataPoints.tsx:7
     1  node_modules/react-native-gifted-charts/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificDataPoints.tsx:5
     1  node_modules/react-native-gifted-charts/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificVerticalLines.tsx:4
     2  node_modules/react-native-gifted-charts/src/Components/BarAndLineChartsWrapper/renderVerticalLines.tsx:6
     1  node_modules/react-native-gifted-charts/src/Components/BarSpecificComponents/barBackgroundPattern.tsx:4
     1  node_modules/react-native-gifted-charts/src/Components/BarSpecificComponents/cap.tsx:5
     1  node_modules/react-native-gifted-charts/src/Components/common/Pointer.tsx:4
     1  node_modules/react-native-gifted-charts/src/Components/common/StripAndLabel.tsx:6
    37  node_modules/react-native-gifted-charts/src/LineChart/index.tsx:411
    16  node_modules/react-native-gifted-charts/src/LineChart/LineChartBicolor.tsx:193
     2  node_modules/react-native-gifted-charts/src/PieChart/index.tsx:32
error Command failed with exit code 2.

Just to clarify, the tsc command itself hasn't been customized in the package.json.

Answer №2

I am the developer in charge of maintaining react-native-gifted-charts.
Starting from version 1.4.22, I have switched to shipping compiled js files instead of ts files. This change is intended to resolve any type-related issues that users may have encountered.
I highly recommend using the latest version of the library for optimal performance.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is it possible to install runtimes for iOS versions in XCode that are not included in the default list?

Looking to set up a simulator in XCode for an iPhone 7 with iOS 14.7.1. When I navigated to Xcode -> Preferences -> Components, I found a list of downloadable runtimes, but version 14.7 was not listed. Is there a way to obtain runtimes for iOS versio ...

Incorporate SVG files into a TypeScript React application using Webpack

I am trying to incorporate an SVG image into a small React application built with TypeScript and bundled using Webpack. However, I am encountering an issue where the image is not displaying properly (only showing the browser's default image for when n ...

Verifying data types in TypeScript

When working with TypeScript in the browser, I often find myself writing code like this: const button = document.getElementById(id); if (!(button instanceof HTMLButtonElement)) { throw new Error("TODO -- insert better error message here"); } bu ...

Creating a ref in React with TypeScript to access the state of a child component

Is there a way to access the state of a child component within the parent component without using handlers in the child or lifting the state up in the parent? How can I utilize refs in React with TypeScript to createRef and retrieve the child's state ...

How to implement a custom pipe for dynamically changing image URLs in Ionic 3's image tag

I am trying to set authentication headers for images called from an image tag (<img>). To achieve this, I have created a custom pipe named secureimages using the command ionic g pipe secureimages. This pipe intercepts the HTTP requests in an interce ...

Can you provide guidance on implementing Material-UI's `withStyles` decorator in a practical scenario?

I'm currently solving the challenge of annotating the types for the different styles in my code. After converting from plain JavaScript to TypeScript, I am now adding type annotations. Here is a snippet of the code: import * as React from 'react ...

Creating a TypeScript function that can dynamically assign values to a range of cells within a column, such as AD1, AD2, AD3, and so on

Hello there I'm currently working on a function that will dynamically assign values to the column range of AE to "AD" + i. However, when I use the function provided below, it only writes AD5 into the first 5 columns instead of AD1, AD2, AD3, and so o ...

Encountering a PropertyTypeError while attempting to process a payment via Stripe in conjunction with use-shopping-cart on Next.js

Upon reaching the checkout page, I encounter the message: Invalid value with type "undefined" was received for stripe. Valid type for stripe is "string". This issue seems to be related to the redirectToCheckout function. Can someone assist me? The cart-s ...

Error TS2345: The function with arguments of type '(req: any, res: any, ctx: any) => any' cannot be assigned to the parameter of type 'HttpResponseResolver<PathParams<string>'

Encountered an issue in a React TypeScript test case involving mock data. The error message received was: TS2345: Argument of type '(req: any, res: any, ctx: any) => any' is not assignable to parameter of type 'HttpResponseResolver<P ...

Exoplayer: video does not automatically adjust size to match screen in portrait mode at start

I am currently facing an issue with the Exoplayer playerview not fitting properly within the frame initially, while also maintaining the video's aspect ratio in portrait mode. The correct resizing of the view only occurs when rotating the device to la ...

Updating Angular 8 Component and invoking ngOninit

Within my main component, I have 2 nested components. Each of these components contain forms with input fields and span elements. Users can edit the form by clicking on an edit button, or cancel the editing process using a cancel button. However, I need to ...

Bring in an Angular Component into a different Component by stating the name of the component as an input parameter

In my project, I am looking to develop an angle component made up of multiple sub-components. The end goal is to construct a versatile tree component with nodes that cater to different data types. Each data type in the tree component will import specific s ...

Incorporating a custom transpiled file format into Typescript imports

I am trying to import a file format .xyz that does not have fixed types for all instances of the format: import { Comment, Article, User } from "./Blog.xyz" However, I keep getting this error message: TS2307: Cannot find module './Blog.xy ...

Is there a more efficient method to tally specific elements in a sparse array?

Review the TypeScript code snippet below: const myArray: Array<string> = new Array(); myArray[5] = 'hello'; myArray[7] = 'world'; const len = myArray.length; let totalLen = 0; myArray.forEach( arr => totalLen++); console.log(& ...

The command 'expo' is not accepted as an internal or external command

After installing expo-cli using npm, I encountered an issue where running "expo --version" resulted in expo not being recognized. I attempted to add the path to the environment variables but it did not resolve the issue. I need to start working on a Reac ...

Adjust the size of a map on an HTML page after it has

Currently, I am utilizing Angular 2 to create a simple webpage that includes a Google 'my map' displayed within a modal. <iframe id="map" class="center" src="https://www.google.com/maps/d/u/0/embed?mid=1uReFxtB4ZhFSwVtD8vQ7L3qKpetdMElh&ll ...

Using TypeScript generics to efficiently differentiate nested objects within a parsed string

Consider the following type code: const shapes = { circle: { radius: 10 }, square: { area: 50 } } type ShapeType = typeof shapes type ShapeName = keyof ShapeType type ParsedShape<NAME extends ShapeName, PROPS extends Sh ...

Using Jest in Typescript to simulate fetch responses

I am currently facing an issue with mocking the global fetch function using Jest and dealing with the Response type. Specifically, I only require the response.ok and response.json properties, but I am struggling to set the return data of fetch without spec ...

Creating a realistic typewriter effect by incorporating Code Block as the input

I am looking to add a special touch to my website by showcasing a code segment with the Typewriter effect. I want this code block not only displayed but also "typed" out when the page loads. Unfortunately, I have been unable to find a suitable solution s ...

Navigating the issue of "Experiencing additional hooks rendered compared to the previous render"

I'm currently in the process of developing a small application where certain elements will be nested within one another. My approach involves segmenting each component into its own file (children), returning a function with two components in each Rend ...