teambit / bit.envs

DEPRECATED - Bit compilers and testers were moved to https://github.com/teambit/envs
https://bit.dev/bit/envs
Other
23 stars 9 forks source link

[React-TypeScript] Cannot find module of dependent bit #49

Closed danielkcz closed 5 years ago

danielkcz commented 5 years ago

Rather strange error. I made a repo for easy reproduction: https://github.com/FredyC/bit-ts-react-test.

error

@qballer Can you please have a look?

qballer commented 5 years ago

thanks for opening an issue @FredyC I will look in to that and get back here.

GiladShoham commented 5 years ago

@FredyC Hi, There is a bug with react-typescript v3.0.16. You should update to version 3.0.17 and it will work.

qballer commented 5 years ago

Yep, I published that version yesterday. It's very strange this wasn't picked up before. It should be fixed. let me know if there is an issue.

danielkcz commented 5 years ago

Awesome seems to be working, that was really lucky to report something that was already fixed :)

qballer commented 5 years ago

We do try. :)

danielkcz commented 5 years ago

Well, it seems that something is still wonky even with 3.0.17. The same error appeared for a different component for some reason...

error: bit failed to build speedlo.hooks/use-route-params@0.2.0 with the following exception:
Command failed: D:\hooks\.bit\components\compilers\react-typescript\bit.envs\3.0.17\components\.dependencies\compilers\typescript\bit.envs\3.0.15\node_modules\typescript\bin\tsc -d

useRouteMatch.ts(1,31): error TS2307: Cannot find module '@bit/speedlo.hooks.use-route-match'.

The bit status has a weird output too... Why does it want to use scoped component instead of local one I wonder. What we did is that before the useRouteParams depended on useRouterContext directly. Now there is useRouteMatch between these two.

pending updates
(use "bit checkout [version] [component_id]" to merge changes)
(use "bit diff [component_id] [new_version]" to compare changes)
(use "bit log [component_id]" to list all available versions)

    > speedlo.hooks/use-route-params current: 0.2.0 latest: 0.2.1

modified components
(use "bit tag --all [version]" to lock a version with all your changes)
(use "bit diff" to compare changes)

     > use-route-match ... ok
     > use-route-params ... ok

I tried upgrading to the latest 3.0.21 and it fails for the same component, but more cryptic error. I assume it's a same thing, but error is swallowed somewhere now.

error: bit failed to build speedlo.hooks/use-route-params@0.2.0 with the following exception:
Command failed with exit code 2 (Unknown system error -2): D:\hooks\.bit\components\compilers\react-typescript\bit.envs\3.0.21\components\.dependencies\compilers\typescript\bit.envs\3.0.25\node_modules\typescript\bin\tsc -d
Error: Command failed with exit code 2 (Unknown system error -2): D:\hooks\.bit\components\compilers\react-typescript\bit.envs\3.0.21\components\.dependencies\compilers\typescript\bit.envs\3.0.25\node_mo
qballer commented 5 years ago

Hi @FredyC, This issue is with the main dist file of the component should be resolved in v3.0.22.

danielkcz commented 5 years ago

@qballer Where did I say anything about the main file? 😕There was different issue #43 which wasn't a problem since v17. Even with v22 the issue I've described in a previous comment still persist. I simply cannot get through tag & build and I don't know what went wrong and why.

image

That line of code it mentions is not anywhere in source files so I really don't know what's going on :/

qballer commented 5 years ago

Lets sort this out on gitter