Troubleshooting
This guide covers common issues you might encounter when using HubSpot Form Builder and how to resolve them.Connection Issues
Error: “localhost refused to connect”
Solution: Ensure both servers are running in separate terminal windows:- Backend should be accessible at
http://localhost:3001 - Frontend should be accessible at
http://localhost:5173 - Check terminal output for any error messages
Error: “Not allowed by CORS”
Solution: Verify thatFRONTEND_URL in your backend .env file matches your actual frontend URL:
For local development:
Make sure to include the trailing slash in
FRONTEND_URL.- Restart the backend server after changing
.env - Clear your browser cache
- Try accessing from an incognito window
CORS Error: “Loopback address space blocked”
Problem: Accessing the app from a Cloudflare tunnel URL while the backend points to localhost. Solution - Option 1 (Recommended for development): Access the app from localhost instead:.env files with the tunnel URLs:
OAuth & Authentication Issues
Error: “Invalid state or code”
Solution:- Check your backend
.envfile:
-
Verify HubSpot app settings:
- Go to HubSpot: Settings → Integrations → Private Apps
- Open your app
- Check that Redirect URL is exactly:
http://localhost:3001/oauth/hubspot/callback - No trailing slash, exact port number
-
For Cloudflare tunnels:
- Update redirect URI to your tunnel URL
- Update it in both HubSpot app settings and
.env
Token Error in /api/forms
Problem: API calls fail with authentication errors after OAuth.
Solution:
-
Verify OAuth flow completed:
- You should see “Connected” status in the UI
- Check browser console for connection confirmation
-
Check backend logs:
- Look for token storage confirmation
- Verify token was successfully retrieved
-
Re-authenticate:
- Click “Cerrar sesión” (Logout)
- Click “Connect to HubSpot” again
- Complete OAuth flow
- Verify required scopes:
HubSpot Integration Issues
Dropdown Not Populating with Forms
Problem: After connecting, the form selector dropdown remains empty. Troubleshooting steps:-
Check browser console (F12):
- Look for failed API requests
- Check for JavaScript errors
-
Verify your HubSpot account has forms:
- Log into HubSpot
- Go to Marketing → Lead Capture → Forms
- Ensure at least one form exists
-
Check backend logs:
- Look for
/api/formsrequest - Verify response contains forms array
- Look for
-
Verify scopes:
- Ensure
formsscope is included inHUBSPOT_SCOPES - Re-authenticate if you recently added the scope
- Ensure
Forms Not Loading Fields
Problem: Selected form doesn’t display fields in the palette. Solution:-
Ensure form has fields:
- Check the form in HubSpot has actual fields defined
- Empty forms will show “Todos los campos están en uso”
-
Check field schema:
- Open browser console
- Look for schema loading errors
- Verify field data structure is valid
Module Generation & Export Issues
Module Generation Fails
Problem: Clicking “Generar Módulo” produces an error. Common causes:-
Empty layout:
- Ensure you have at least one field in the canvas
- Add fields from the palette before generating
-
Missing required fields:
- Required fields (marked with ⭐) must be in the layout
- Check validation warnings
-
Browser compatibility:
- Use a modern browser (Chrome, Firefox, Safari, Edge)
- Ensure JavaScript is enabled
- Verify all required fields are added to the canvas
- Check browser console for specific errors
- Try refreshing the page and rebuilding the layout
ZIP Download Not Working
Problem: “Descargar Módulo” button doesn’t download the file. Solution:-
Check browser download settings:
- Ensure downloads are not blocked
- Check your Downloads folder
-
Try different browser:
- Test in Chrome/Firefox if using Safari
- Some browsers handle blob downloads differently
-
Check browser console:
- Look for download-related errors
- Verify ZIP generation completed
Environment & Configuration Issues
Missing Environment Variables
Problem: Server crashes with “Missing env var” error. Solution: Ensure all required variables are set: Backend (main/server/.env):
main/frontend/.env):
Port Already in Use
Problem: Backend fails to start with “Port 3001 already in use”. Solution: Option 1 - Kill the existing process:Build & Compilation Errors
TypeScript Compilation Errors
Problem: Build fails with TypeScript errors. Solution:- Ensure dependencies are installed:
- Check TypeScript version:
- Clean and rebuild:
Module Import Errors
Problem: “Cannot find module ‘shared’” or similar errors. Solution: Theshared package is a local workspace dependency. Install from the project root:
Drag & Drop Issues
Fields Not Draggable
Problem: Cannot drag fields from palette or within canvas. Solution:-
Browser compatibility:
- Use Chrome, Firefox, Safari, or Edge (latest versions)
- Disable browser extensions that might interfere
-
Check console for errors:
- Open DevTools (F12)
- Look for dnd-kit related errors
-
Verify field is available:
- Field must be in palette to drag from there
- Field must be in canvas to reorder
Cannot Drop Field / Drop Zones Not Appearing
Problem: Drop zones don’t highlight or field doesn’t drop. Solution:-
Row is full:
- Maximum 3 fields per row
- Create a new row or drop in a different position
-
Field already in use:
- Each field can only appear once in the layout
- Check if field is already placed elsewhere
-
Drop in correct zone:
- Top 20% of field = new row above
- Center = add to same row
- Bottom 20% = new row below
Performance Issues
Slow Performance / Lag
Problem: Application is slow or unresponsive. Solution:-
Large forms:
- Forms with 50+ fields may be slower
- Consider splitting into multiple forms
-
Browser performance:
- Close unnecessary browser tabs
- Clear browser cache
- Restart browser
-
Check system resources:
- Ensure adequate RAM available
- Close other applications
Debugging Tips
Enable Detailed Logging
Enable Detailed Logging
Backend logging:Frontend logging:
Check Browser Console
Check Browser Console
- Open DevTools: Press
F12or right-click → Inspect - Go to Console tab
- Look for:
- Red error messages
- Failed network requests (4xx, 5xx)
- JavaScript exceptions
- Check Network tab for API calls
Verify Server Responses
Verify Server Responses
Use curl or Postman to test backend endpoints:
Reset Application State
Reset Application State
If issues persist, reset the application:
-
Clear browser storage:
- Open DevTools → Application tab
- Clear Local Storage and Session Storage
- Refresh page
-
Restart servers:
- Stop both frontend and backend (Ctrl+C)
- Restart both servers
-
Re-authenticate:
- Logout from HubSpot connection
- Complete OAuth flow again
Getting Help
Still Having Issues?
If you’re still experiencing problems after trying these solutions:
-
Check existing GitHub issues:
- Search for similar problems
- Check if issue is already reported
-
Create a new issue:
- Go to the GitHub repository
- Click “Issues” → “New Issue”
- Provide:
- Detailed description of the problem
- Steps to reproduce
- Error messages (console logs)
- Environment details (OS, Node version, browser)
- Screenshots if applicable
-
Include diagnostic information:
Documentation: For more information, check:
- Quick Reference - Setup guide
- Development Guide - Development workflow
- FAQ - Frequently asked questions
