Styles Not Applied
If components don’t appear styled correctly, you may be missing the Provider wrapper.Solution
Wrap your application with theProvider component (for natds-web) or ThemeProvider (for natds-react):
- natds-web
- natds-react
Invalid Hook Call
This error typically occurs due to React version mismatches.Check React Dependencies
Check for multiple React versions
Run these commands to detect duplicate React installations:Look for multiple version entries in the output.
Deduplicate dependencies
Run npm dedupe to resolve duplicate packages:Then try running your application again.
Material-UI Conflicts
If you have@material-ui/core installed directly:
- Check if you have conflicting versions
- Try varying your
@material-ui/coreversion - Consider uninstalling
@material-ui/coreand reinstalling@naturacosmeticos/natds-web
TypeScript Duplicate Identifier Errors
This occurs when TypeScript finds duplicate type definitions.Solution
Font Loading Issues
If fonts don’t load correctly, ensure they’re properly included.For natds-web
Add fonts to your HTML:For natds-react
Import fonts in your ThemeProvider setup - see Theme Provider documentation.Build Warnings
Peer Dependency Warnings
If you see peer dependency warnings during installation:Bundle Size Warnings
If your bundle size is unexpectedly large:- Use tree-shaking with ES modules
- Import only the components you need
- Consider code splitting for large applications
Component Not Rendering
If a component renders but appears broken or unstyled:Check console for errors
Check console for errors
Open browser DevTools and look for:
- JavaScript errors
- Failed network requests
- React warnings
Verify imports
Verify imports
Ensure you’re importing from the correct package:
Check required props
Check required props
Some components require specific props to render correctly. Check the component documentation.
Server-Side Rendering (SSR)
For Next.js or other SSR frameworks:CSS-in-JS Hydration
Add Material-UI’s SSR setup for natds-web:Production Build Issues
Minification Errors
If your production build fails:- Check for console.log statements using optional chaining
- Ensure your build tools support ES2019+
- Add polyfills if targeting older browsers
Missing Dependencies
Ensure all dependencies are independencies, not devDependencies:
Still Having Issues?
If these solutions don’t resolve your issue:- Update npm globally:
npm install -g npm - Clear all caches:
- Check the GitHub Issues
- Create a new issue with:
- Your package versions
- Complete error messages
- Minimal reproduction code
Common Error Messages
Warning: Invalid hook call
Warning: Invalid hook call
Cause: Multiple React versions or incorrect React versionFix: Run
npm ls react and npm dedupe, ensure React >= 16.8.4Module not found: Can't resolve '@naturacosmeticos/natds-icons'
Module not found: Can't resolve '@naturacosmeticos/natds-icons'
Cause: Missing icon packageFix: Icons are bundled with natds-react and natds-web, reinstall the main package
TypeError: Cannot read property 'palette' of undefined
TypeError: Cannot read property 'palette' of undefined
Cause: Missing theme providerFix: Wrap your app with Provider or ThemeProvider
useTheme() may only be used in a descendant of ThemeProvider
useTheme() may only be used in a descendant of ThemeProvider
Cause: Component is rendered outside theme providerFix: Ensure all components using theme are inside Provider/ThemeProvider
Related Documentation
Installation Guide
Proper setup instructions
Theme Provider
Theming configuration
TypeScript Guide
TypeScript best practices
GitHub Issues
Report bugs and get help

