Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Typescript/yarn workspaces - Referenced project may not disable emit

$
0
0

I'm trying to setup a monorepo project using typescript and yarn workspaces.

The project's structure looks like this:

/example/packages  /lib1

Example is an app that used the packages, for development purposes.

When I use yarn tsc --build --force I get the following error:

example/tsconfig.json:6:18 - error TS6310: Referenced project '/packages/intro' may not disable emit.

Here's example's tsconfig.json:

{"extends": "../tsconfig.json","compilerOptions": {"outDir": "./lib"  },"references": [{ "path": "../packages/intro" }]}

And the one at the project's root:

{"$schema": "https://json.schemastore.org/tsconfig","display": "React Native","compilerOptions": {"allowJs": true,"allowSyntheticDefaultImports": true,"baseUrl": ".","composite": true,"declaration": true,"esModuleInterop": true,"isolatedModules": true,"jsx": "react-native","lib": ["es2017"],"module": "commonjs","moduleResolution": "node","noEmit": true,"paths": {"my-project/*": ["./packages/*/src"]    },"resolveJsonModule": true,"skipLibCheck": true,"strict": true,"target": "esnext"  },"exclude": ["packages/*/lib","node_modules","babel.config.js","metro.config.js","jest.config.js"  ],"references": [{ "path": "./example" }, { "path": "./packages/lib1" }]}

And the lib1's tsconfig.json:

{"extends": "../../tsconfig.json","compilerOptions": {"outDir": "./lib"  }}

As you can see I do have noEmit set to true so I don't understand what the error is about. I've tried setting the value directly in each tsconfig files but that didn't do anything as expected.


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>