This is a minimal reproduction of failing to transpile local dependencies in a monorepo using Lerna, Yarn Workspaces and Flow.
The structure of the project is:
root
|
|__ apps/next-app # the next application
|
|__ components/htz-components # shared ui components
|
|__ libs/htz-react-base # A library providing a babel-preset
To reproduce the issue:
git clone https://github.com/TxHawks/next-flow-transpile-repro.git
cd next-flow-transpile-repro
yarn && yarn bootstrap
You should see the following error:
ModuleParseError: Module parse failed: Unexpected token (3:12)
You may need an appropriate loader to handle this file type.
| // @flow
| import React, { useState, } from 'react';
> import type { Node, } from 'react';
|
| type PropTypes = {