-
Notifications
You must be signed in to change notification settings - Fork 9
Common Issues
This is caused by two styled-components being loaded during the test of your project.
Please follow the steps below.
- Remove
styled-components
indevDependencies
of the ui-components package.json - run
yarn build:watch
- Proceed normal yarn link procedure
- Revert changes in package.json and yarn.lock before commit
This will force the root library to use its own styled-components
dependency.
Webpack has issue to import peerDependencies
when they are:
-
dependencies
of the root project - both
peerDependencies
anddevDependencies
at the same time in the child project
This will cause webpack to import the devDependencies
in the child project but not the root project
which causes the same package imported twice (one in root, another one in child)
This usually causes the following errors
An unexpected error occurred: "https://registry.yarnpkg.com/@types%2fintellihr__ui-components: Not found"
It is caused by the cache of the loaders. Simply run
rm -rf ./node_modules/.cache/
Then rebuild your project
Styleguidist uses source code inspection to figure out component names and proptypes. This can cause names to be incorrect depending upon how your source code is formatted. e.g.
const Component = styled(Thing)
export {
Component
}
will give StyledComponentClass
as the name for the component, rather than Component
.
You can usually fix this by exporting the component where it is defined:
export const Component = styled(Thing)
Github issue: https://github.com/s-panferov/awesome-typescript-loader/issues/432
Files containing only an interface will not be built by awesome-typescript-loader. If you have a file with only a type/interface you will need to add and export a dummy variable to trick the loader into generating the file.
interface a {}
const b = {}
export { a, b }