teambit / envs

Component development environments for the Bit community
https://bit.dev/bit/envs
Other
64 stars 9 forks source link

react-typescript: Cannot find module '../../components/core/capsule' #126

Open romrg opened 4 years ago

romrg commented 4 years ago

Describe the bug

Unable to compile a component with react-typescript env.

Steps to Reproduce

  1. Create an app with create-react-app with Typescript

npx create-react-app my-app --template typescript

  1. Put react and react-dom as peer dependencies
  2. bit init
  3. Install the bit react-typescript env

bit import -c bit.envs/compilers/react-typescript

  1. Create a dummy component MyComponent with the following code for example:
import React from 'react';

export default () => <div/>;
  1. Track the component: bit add src/MyComponent
  2. Build: bit build my-component

Used this tutorial : https://medium.com/@vagacoder/how-to-use-react-and-typescript-in-bit-dev-89a1260d2d9f

Expected Behavior

A successful build is expected since the environment is basic and the component minimal.

Screenshots, exceptions and logs

error: bit failed to build my-component with the following exception: Cannot find module '../../components/core/capsule'

Specifications

YacheLee commented 3 years ago

The same issue here