Skip to content

Seemingly false alerm in monorepo: This syntax requires an imported helper but module 'tslib' cannot be found. #46288

@vilicvane

Description

@vilicvane

Bug Report

The project uses yarn workspaces and has many packages with structures like:

- node_modules/
- package.json
- packages/
   - app/
     - node_modules/ 
     - package.json
   - server
     - node_modules/
     - package.json

In my case "tslib" is added to every relevent nested package.json but obviously it's only present under root node_modules/.

🔎 Search Terms

🕗 Version & Regression Information

This changed between versions 4.4.3 and 4.5.0-beta

💻 Code

import * as ReactDOM from 'react-dom';

🙁 Actual behavior

packages/app/src/program/main.tsx:3:1 - error TS2354: This syntax requires an imported helper but module 'tslib' cannot be found.

3 import * as ReactDOM from 'react-dom';
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

🙂 Expected behavior

No error.


Let me know if a repro is needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs More InfoThe issue still hasn't been fully clarified

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions