Skip to content

Finding types from external dependencies when using Yarn workspaces #5107

Open
@TxHawks

Description

@TxHawks

I'm running into an issue when using flow in a yarn workspaces enabled monorepo

After installing polished with yarn workspace workspace-name add polished I have a dependencies.polished entry in my workspace-name's package.json, and a polisheddirectory under the repository's root node_modules directory, as expected.

Having a file in the workspace directory with:

import {  rgba, } from 'polished';

Spits out:

import { rgba, } from 'polished';
                      ^^^^^^^^^^ polished. Required module not found

It all works just fine when run Flow from the root directory, to which node_modules directory Yarn installs all the different workspaces' dependencies into.

I'd expect Flow to look for type definitions in node_modules directories up the tree, in line with how npm and Yarn work.

Flow version : 0.57.2
node version: 8.4.0
Yarn verson: 1.2.1

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