Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@nx/js:tsc fails with yarn PnP on Windows #28414

Open
1 of 4 tasks
fpaul-1A opened this issue Oct 11, 2024 · 0 comments
Open
1 of 4 tasks

@nx/js:tsc fails with yarn PnP on Windows #28414

fpaul-1A opened this issue Oct 11, 2024 · 0 comments

Comments

@fpaul-1A
Copy link

fpaul-1A commented Oct 11, 2024

Current Behavior

Starting from 19.6.1 (#27300), the executor @nx/js:tsc stopped working with Yarn PnP on Windows
The same problem is still occurring in version 20

Compiling TypeScript files for project "mylib"...
/git_clones/sandbox/test-pnp/packages/mylib/src/index.ts:1:1 - error TS2354: This syntax requires an imported helper but module 'tslib' cannot be found.

1 export * from './lib/mylib';
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The dependency tslib is present both at the root of the workspace and in the project mylib

The exact same code works with any of the following:

Expected Behavior

The build should be successful

GitHub Repo

No response

Steps to Reproduce

  1. npx create-nx-workspace test-pnp --packageManager=yarn default answers
  2. cd test-pnp
  3. yarn set version stable
  4. echo nodeLinker: pnp >> .yarnrc.yml
  5. yarn
  6. yarn nx g lib packages/mylib
  7. Create packages/mylib/project.json with the following:
{
  "$schema": "https://raw.githubusercontent.com/nrwl/nx/master/packages/nx/schemas/project-schema.json",
  "targets": {
    "build": {
      "executor": "@nx/js:tsc",
      "options": {
        "tsConfig": "packages/mylib/tsconfig.lib.json",
        "outputPath": "packages/mylib/dist",
        "main": "src/index.ts"
      }
    }
  }
}
  1. yarn nx build mylib
  2. See errors in console

Nx Report

 NX   Report complete - copy this into the issue template

Node           : 20.17.0
OS             : win32-x64
Native Target  : x86_64-windows
yarn           : 4.5.0

nx          : 20.0.0
@nx/js      : 20.0.0
typescript  : 5.5.4
---------------------------------------
Registered Plugins:
@nx/js/typescript

Failure Logs

No response

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

I've previously opened an issue #27656 but it has been closed even though this is still happening in Nx 20 and I cannot reopen the issue.
Maybe my description was not clear enough so I've tried adding more details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants