Repository navigation
Closed
Description
Describe the bug
I have a component that exports the component along with its types. when I run bit build, I get the following error:
⠄⠀ isolating component - concrete/cta-buttonbase/primary-button/index.tsx:3:10 - error TS2305: Module '"../../../../../T/bit/capsule-92348/.dependencies/base/primary-button/bit.marketing/0.0.1/dist"' has no exported member 'ButtonProps'.
3 import { ButtonProps } from '@bit/bit.marketing.base.primary-button';
~~~~~~~~~~~
Found 1 error.
error: bit failed to build bit.marketing/concrete/cta-button@0.0.1 with the following exception:
Command failed with exit code 2 (ENOENT): /Users/oded/code/base-components/.git/bit/components/compilers/react-typescript/bit.envs/3.1.43/components/.dependencies/compilers/typescript/bit.envs/3.1.38/node_modules/typescript/bin/tsc --declaration
Error: Command failed with exit code 2 (ENOENT): /Users/oded/code/base-components/.git/bit/components/compilers/react-typescript/bit.envs/3.1.43/components/.dependencies/compilers/typescript/bit.envs/3.1.38/node_modules/typescript/bin/tsc --declaration
at makeError (/Users/oded/code/base-components/.git/bit/components/compilers/react-typescript/bit.envs/3.1.43/components/.dependencies/compilers/typescript/bit.envs/3.1.38/node_modules/execa/lib/error.js:59:11)
at handlePromise (/Users/oded/code/base-components/.git/bit/components/compilers/react-typescript/bit.envs/3.1.43/components/.dependencies/compilers/typescript/bit.envs/3.1.38/node_modules/execa/index.js:112:26)
at process._tickCallback (internal/process/next_tick.js:68:7)
see the components here:
https://bit.dev/bit/marketing/concrete/cta-button
https://bit.dev/bit/marketing/base/primary-button
https://bit.dev/bit/gui/base/button
these components enhance the prev component and have them as a dependency along with their types.
cta-button -> primary-button -> base/button
the problem was resolved when I tagged base/primary-button with the --skip-auto-tag flag.
the I could tag concrete/cta-button.
Steps to Reproduce
- import the following components:
bit import bit.gui/base/button@0.0.8bit import bit.marketing/base/primary-button@0.0.2bit import bit.marketing/concrete/cta-button@0.0.2
- modify
base/primary-button - run
bit tag -a
Expected Behavior
bit should recognize the exported types.
Specifications
- Bit version: 14.7.2
- Node version: v10.15.3
- yarn version: 1.13.0
- Platform: macos
- Bit compiler (include version): bit.envs/compilers/react-typescript@3.1.43
- Bit tester (include version): bit.envs/testers/mocha@5.0.2
Activity
davidfirst commentedon Apr 10, 2020
This is probably a result of the useless dists generated by TS compiler for the author.
When using module paths, typescript tries to resolve the component from the dists and more often than not, it doesn't find them there.
It's going to be fixed with the next major version (Harmony).
l0gicgate commentedon Apr 14, 2020
I'm experiencing the exact same problem. Is there a workaround for now?
GiladShoham commentedon Apr 19, 2020
@odedre How did you workaround this?
@Tallyb @qballer any idea about how to work around it?
itaymendel commentedon Mar 7, 2021
irrelevant for v15
We'll start rolling out v15 of Bit this week, please reach out to me privately on the public slack community for a sneak peek and getting early access to it.