I have a button component and I want to add a story file to it.
I created a button.story.tsx file with the following code:
import React from 'react';
import {CtaButton} from '@bit/bit.marketing.concrete.cta-button';
import {Theme} from '@bit/bit.marketing.theme.theme-provider';
export const withTheme = () => (
<Theme>
<CtaButton>Cta button</CtaButton>
</Theme>
);
and added it to my existing button component.
when I run bit build, I get the following exception:
⡋⠁ isolating component - concrete/cta-buttonconcrete/cta-button/cta-button.story.tsx:2:25 - error TS2307: Cannot find module '@bit/bit.marketing.concrete.cta-button'.
2 import {CtaButton} from '@bit/bit.marketing.concrete.cta-button';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error.
error: bit failed to build bit.marketing/concrete/cta-button@0.0.4 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)
I tried to run bit link and it ran without errors, but it didnt help when I tried to build again.
the required @bit links in the node_modules are present and link back to the source code as expected. It seems like the compiler does not recognize the component in my workspace.
Steps to Reproduce
create 2 components. a and b.
make a dependent on b with a relative import.
export both of them to a bit.dev scope.
change the require in a to use the bit id in bit.dev (@bit)
run bit build
Expected Behavior
the compiler should recognize that both components are in my workspace when I import them using a bit id
Describe the bug
I have a button component and I want to add a story file to it. I created a
button.story.tsx
file with the following code:and added it to my existing button component. when I run
bit build
, I get the following exception:I tried to run
bit link
and it ran without errors, but it didnt help when I tried to build again.the required
@bit
links in thenode_modules
are present and link back to the source code as expected. It seems like the compiler does not recognize the component in my workspace.Steps to Reproduce
a
andb
.a
dependent onb
with a relativeimport
.a
to use the bit id in bit.dev (@bit
)bit build
Expected Behavior
the compiler should recognize that both components are in my workspace when I import them using a bit id
Specifications