Despite Typescript Errors, Turbo Repo Continues to Generate Builds

In my turborepo monorepo, the structure looks like this:

apps
|- app1
|- app2

packages
|- lib
   | .... some files
   |- tsconfig.json
   |- package.json

Within the lib directory, I intentionally included a file with an obvious error. The editor correctly reports the error while editing:

const a: String = 23;
console.log(a);

I am also importing this erroneous file in one of my apps. Surprisingly, when I attempt to build the project using npm run build, it builds without any errors despite not having set an option to ignore errors.

The interesting part is that the build only fails if I place this intentionally flawed file within one of the apps. In that case, it does identify the error and halts the build process.

Here is the tsconfig configuration for the lib:

{
  "compilerOptions": {
    "target": "es2016",
    "module": "commonjs",
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "skipLibCheck": true,
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "noEmit": true,
    "incremental": true,
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "moduleResolution": "node"
  },
  "include": ["."],
  "exclude": ["dist", "build", "node_modules"]
}

Interestingly, I have a very similar tsconfig file in my apps as well:

{
  "compilerOptions": {
    "target": "es2016",
    "module": "commonjs",
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "skipLibCheck": true,
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "noEmit": true,
    "incremental": true,
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "moduleResolution": "node"
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
  "exclude": ["node_modules"]
}

Answer №1

Dealing with a comparable issue, I found that by installing a reliable release of nodejs, the problem was resolved.

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

Replace Material UI propTypes with new definitions

I am currently working with React, Typescript, and Material UI. To globally disable the ripple effect for the ListItem component, I am using createMuiTheme.props in the following manner: createMuiTheme({ props: { MuiListItem: { disableRipple: t ...

Ensuring Consistent npm Configurations Across Team Projects: A Guide for Setting Up per Project Configurations

Not too long ago, I encountered an issue with running npm install. I had to resort to using either npm install --legacy-peer-deps or npm config set legacy-peer-deps true. I'm not entirely sure of the reason behind this issue, but since this is a team ...

Create an Angular 2 webpack production project and ensure that the dist folder does not contain any source code

I am currently developing a web application using Angular 2 with TypeScript and angular-cli. I needed to test the application on the server without uploading the source code, so I used the command "ng build --prod". Despite deleting all .map files from the ...

Modifying the color of the chosen item - ion-select

Can anyone help me with changing the color of the selected item on ion-select? I've tried several solutions without success. Any suggestions? Documentation: https://ionicframework.com/docs/api/select I attempted to use the color property, but it did ...

Typescript and Javascript global variables

I am looking to set up a global variable with a default value const Months = [ { name: 'January' }, { name: 'February' }, { name: 'March' }, { name: 'April' }, { name: 'May' }, { name: 'June' }, { ...

Ways to include various inputs with chip

I am currently working on a project that involves implementing an email field using the chip component. However, I have encountered an issue where pasting multiple email values for the first time inserts them into the field successfully. But when I try to ...

Warnings during NestJS Compilation

Currently, I am diving into the world of NestJS and encountering some difficulties with the code snippet below. The warning coming from @nestJS states "nestjs: Unknown word.cSpell" When using functions like status and send, I'm receiving a warning th ...

While running the `sudo npm install` command, I encountered an error with

Release Info node-gyp : v2.0.2 npm : v2.13.4 node : v0.12.7 An issue arose when attempting to use "sudo npm install exec-sync" $ sudo npm install exec-sync gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack ...

The generation of the npm bin script is not working as expected on Windows operating systems

I'm working on developing an NPM package for command line use. I've set up npm's bin in my package.json to specify the JS file to be executed. Here is a snippet from my package.json: "name": "textree", "bin": { "textree": "./src/cli.js" ...

The following error occurred: "Error: enoent, could not rename file 'somelocationappshell.gyp.txt'

While attempting to develop an installer using cmd (nodejs), I encountered the following error: Error: enoent, rename 'somelocation\appshell.gyp.txt' This issue arose immediately after running the command grunt install --force. What cou ...

Setting up a Node application on a server with the help of Apache, npm, and pm

            I recently deployed a Node.js application (myapp.js) on a server with a specific IP address. The installation and startup process using npm went smoothly this time around, unlike past experiences with Apache which were much more complic ...

Retrieve an item from an array using a Select component

Is there a way to retrieve the complete object representation of an item from a list in React? Currently, when I select an item and call handleChangeSelectAuto, the original value from useState is returned instead of the entire object. How can I ensure tha ...

Mastering the manipulation of complex nested objects within React state

Welcome, fellow developers! I am a junior developer currently working on a project that involves a large nested object structure (see example below). I am looking for the best approach to use this as a React state that can be accessed from multiple compon ...

Is it possible to capture and generate an AxiosPromise inside a function?

I am looking to make a change in a function that currently returns an AxiosPromise. Here is the existing code: example(){ return api.get(url); } The api.get call returns an object of type AxiosPromise<any>. I would like to modify this function so ...

Could you please clarify the type of event on the onInputChange props?

I am encountering an issue with using React.ChangeEvent on the mui v4 autocomplete component as I prefer not to use any other method. However, I keep getting an error indicating that the current event is incompatible. const handle = (e: React.ChangeEv ...

Obtain a tuple of identical length from a function

I'm attempting to create a function that returns a tuple with the same length as the parameter tuple passed to it. Although I tried using generics, I am encountering an error when applying the spread operator on the result. My goal is best illustrate ...

Is it possible to verify a file's type with Nestjs Pipes and the FileTypeValidator?

I am facing an issue with implementing a Nestjs route in a controller that includes a file upload using Multer. The goal is to edit a user's profile picture, so I need to validate that the uploaded file is an image. However, despite using the FileType ...

The significance of having spaces in the PATH for npm

Attempting to set up gulp, but encountering the following error: module.js:471^throw err : cannot find module 'C:\c\Users\Joe's Steezy Laptop\AppData\Roaming\npm\node_modules\gulp-cli\bin\gul ...

Discovering Version Ranges with npm View: A Step-By-Step Guide

When looking for all versions of a package, you can use npm view some-pkg versions. To find the latest version of a package, you can utilize npm view some-pkg@latest version. However, if you need to query for the latest version within a specific semver r ...

It appears that Yarn is having trouble properly retrieving all the necessary files for a package

Recently, I encountered a strange issue in our project involving 3 microservices, all using the exceljs library. Two of the microservices successfully download all necessary files for this package through yarn. However, the third microservice is missing ...