β Troubleshooting & FAQ
Common issues, solutions, and frequently asked questions π§
This guide covers the most common issues developers encounter when working with Nodeblocks frontend components and their solutions.
π Table of Contentsβ
- π¨ Installation Issues
- βοΈ React Compatibility
- π Authentication & Registry
- π§ Configuration Problems
- π¨ Styling & UI Issues
- β Frequently Asked Questions
π¨ Installation Issuesβ
Package Not Found Errorβ
Problem:
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@nodeblocks%2ffrontend-navbar-block
Solutions:
- Check your .npmrc configuration:
# Verify .npmrc exists and has correct content
cat .npmrc
- Ensure token is set:
echo $NODEBLOCKS_DEV_TOKEN
- Verify registry configuration:
@nodeblocks:registry=https://registry.npmjs.org
@basaldev:registry=https://registry.npmjs.org
//registry.npmjs.org/:_authToken=${NODEBLOCKS_DEV_TOKEN}
Authentication Failed (401 Error)β
Problem:
npm ERR! 401 Unauthorized - GET https://registry.npmjs.org/@nodeblocks/...
Solutions:
-
Check token validity:
- Contact Nodeblocks team for a new token
- Ensure token hasn't expired
-
Verify environment variable:
# Linux/macOS
export NODEBLOCKS_DEV_TOKEN=your_actual_token_here
# Windows
set NODEBLOCKS_DEV_TOKEN=your_actual_token_here
- Clear npm cache:
npm cache clean --force
Peer Dependency Warningsβ
Problem:
npm WARN peer dep missing: react@^18.0.0, required by @nodeblocks/frontend-navbar-block
Solution: Install the correct React version:
npm install react@^18.0.0 react-dom@^18.0.0
npm install --save-dev @types/react@^18.0.0 @types/react-dom@^18.0.0
βοΈ React Compatibilityβ
React 19 Compatibility Issuesβ
Problem: Components not working with React 19.
Solution: Nodeblocks currently requires React 18. Downgrade your React version:
# Downgrade to React 18
npm install react@^18.0.0 react-dom@^18.0.0
# Update TypeScript types
npm install --save-dev @types/react@^18.0.0 @types/react-dom@^18.0.0
When will React 19 be supported? We're actively working on React 19 compatibility. Follow our changelog for updates.
π Authentication & Registryβ
Cannot Access Private Packagesβ
Problem:
Getting 404 or access denied errors for @nodeblocks
packages.
Checklist:
- β
.npmrc
file exists in project root - β Registry configuration is correct
- β
NODEBLOCKS_DEV_TOKEN
environment variable is set - β Token is valid and not expired
- β You have access permissions
Quick Fix:
# Check current npm configuration
npm config list
# Verify nodeblocks registry setting
npm config get @nodeblocks:registry
Token Environment Variable Not Workingβ
Problem: Token set but still getting authentication errors.
Solutions:
- For current session:
# Linux/macOS
export NODEBLOCKS_DEV_TOKEN=your_token
# Windows Command Prompt
set NODEBLOCKS_DEV_TOKEN=your_token
# Windows PowerShell
$env:NODEBLOCKS_DEV_TOKEN="your_token"
- For permanent setup:
# Linux/macOS - Add to ~/.bashrc or ~/.zshrc
echo 'export NODEBLOCKS_DEV_TOKEN=your_token' >> ~/.bashrc
# Windows - Use System Environment Variables
- Verify token is loaded:
npm install --verbose
π§ Configuration Problemsβ
Environment Variables Not Workingβ
Problem: Service endpoints not being loaded from environment variables.
Framework-Specific Solutions:
Vite:
# Must start with VITE_
VITE_USER_SERVICE_URL=https://api.example.com
// Access in component
const userServiceUrl = import.meta.env.VITE_USER_SERVICE_URL;
Create React App:
# Must start with REACT_APP_
REACT_APP_USER_SERVICE_URL=https://api.example.com
// Access in component
const userServiceUrl = process.env.REACT_APP_USER_SERVICE_URL;
π¨ Styling & UI Issuesβ
Components Look Different Than Expectedβ
Problem: Components don't match the expected design or documentation.
Solutions:
- Check for global CSS conflicts:
/* Your global styles might be interfering */
* {
box-sizing: border-box; /* This might affect component layouts */
}
- Use component-specific styling:
<SignIn
style={{
maxWidth: '400px',
margin: '0 auto',
padding: '2rem'
}}
>
{/* Component content */}
</SignIn>
- When components don't accept styles:
/* Use higher specificity to override component styles */
#root .your-component-class {
/* Your custom styles here */
background-color: #f5f5f5;
border-radius: 8px;
padding: 1rem;
}
/* For more specific overrides, use multiple selectors */
#root .product-grid .product-item {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
transition: transform 0.2s ease;
}
β Frequently Asked Questionsβ
General Questionsβ
Q: Can I use Nodeblocks with React 19? A: Not currently. Nodeblocks requires React 18. React 19 support is in development.
Q: Do I need to install all components? A: No! Install only the components you need. Each component is a separate package.
Q: Can I customize the styling? A: Absolutely! Components accept style props and can be styled with CSS-in-JS or CSS modules.
Technical Questionsβ
Q: Do Nodeblocks work with TypeScript? A: Yes, all components include TypeScript definitions.
Q: Can I use Nodeblocks with state management libraries like Redux? A: Yes, but the Domain App provides built-in state management. You can integrate with external state if needed.
Q: How do I handle form validation?
A: Use the onChange
prop with setError
, getValues
, and clearErrors
functions.
Q: Can I override component behavior? A: Yes, for example using the block overriding pattern. See our Advanced Usage Guide.
Having a different issue? Contact our support team with details about your specific problem.