Skip to content

Project reference isn't working if rootDir is set #868

Closed
@alfaproject

Description

@alfaproject

Expected Behaviour

A project reference that has a rootDir set should work properly

Actual Behaviour

'lambda-common' has outDir set to ./dist and rootDir set to ./src and 'lambda-graphql' references 'lambda-common':

Error: Could not find output JavaScript file for input ../lambda-common/src/index.ts (looked at ../lambda-common/dist/src/index.js).
The input file is part of a project reference located at ../lambda-common/tsconfig.json, so ts-loader is looking for the project’s pre-built output on disk. Try running `tsc --build` to build project references.
    at successLoader (/lambda-graphql/node_modules/ts-loader/dist/index.js:46:19)
    at Object.loader (/lambda-gaming/lambda-graphql/node_modules/ts-loader/dist/index.js:22:12)

ts-loader is looking for dist/src/index.js instead of dist/index.js

Steps to Reproduce the Problem

Create a project reference to a project that sets rootDir to some child folder like ./src, compile with tsc -b and then attempt to use ts-loader on the parent project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions