Troubleshooting & FAQ
Common issues, solutions, and frequently asked questions for NetFUNNEL JavaScript Agent integration.
Installation Issues
Agent Script Not Loading
Symptoms:
- No
netfunnel-javascript-agent.jsin Network tab - HTTP 404 or other errors for agent file
Solutions:
- Check script URL: Verify the
srcURL is correct and accessible - Network connectivity: Ensure your server can reach NetFUNNEL servers
- Ad blockers: Disable ad blockers that might block the script
- Script placement: Move script to very top of
<head>tag
<!-- Correct placement -->
<head>
<script src="https://agent-lib.stclab.com/agents/client/javascript/netfunnel-javascript-agent.js" data-nf-client-id="your-client-id"></script>
<!-- other scripts -->
</head>
Settings File Not Loading
Symptoms:
- No
nf-setting.jsonin Network tab - HTTP errors for settings file
Solutions:
- Check
data-nf-client-id: Verify the client ID is correct - Console access: Ensure you have proper access to NetFUNNEL console
- Segment activation: Verify your segment is activated in console
Bypass Mode (No Waiting Room)
Symptoms:
- Users access pages directly without waiting room
- No NetFUNNEL traffic control
Solutions:
- Required attributes: Ensure
data-nf-client-idis present - Segment activation: Check segment is activated in console
- Limited Inflow: Verify Limited Inflow is not set to unlimited
- Trigger rules: Confirm trigger rules match your URLs correctly
Function Call Errors
"nfStart is not a function" Error
Symptoms:
ReferenceError: nfStart is not defined- Functions undefined when called
Solutions:
- Function availability check: Always check if functions exist before calling
if (typeof window.nfStart === 'function') {
nfStart(keys, callback);
} else {
// Fallback logic
console.log('NetFUNNEL not available');
}
- Script loading order: Ensure NetFUNNEL script loads before your code
- Wait for load: Call functions after
window.loadevent
window.addEventListener('load', function() {
// Safe to call NetFUNNEL functions here
});
Callback Not Executing
Symptoms:
nfStartcalled but callback never fires- No response received
Solutions:
- Check network: Verify network requests to NetFUNNEL server
- Console logs: Enable
data-nf-print-log="true"for debugging - Segment status: Ensure segment is not in Block state
- Limited Inflow: Check if Limited Inflow allows entry
Network & Connection Issues
Network Timeout Errors
Symptoms:
NetworkErrorwith status code 1002- Requests timing out
Solutions:
- Increase timeout: Set
data-nf-network-timeoutto higher value (max 10000ms) - Retry configuration: Increase
data-nf-retry-count - Network recovery: Enable
data-nf-use-network-recovery-mode="true"
<script
src="https://agent-lib.stclab.com/agents/client/javascript/netfunnel-javascript-agent.js"
data-nf-client-id="your-client-id"
data-nf-network-timeout="5000"
data-nf-retry-count="2"
data-nf-use-network-recovery-mode="true"
></script>
Network Not Connected Errors
Symptoms:
NetworkErrorwith status code 1001- No internet connectivity
Solutions:
- Check connectivity: Verify internet connection
- Firewall: Ensure NetFUNNEL domains are not blocked
- Proxy settings: Configure proxy if needed
- Error handling: Implement proper NetworkError handling
function nfCallback(response) {
if (response.status === 'NetworkError') {
// Show user-friendly message
alert('Network connection issue. Please check your internet connection.');
// Optionally retry or proceed anyway
}
}
Waiting Room Issues
Waiting Room Not Displaying
Symptoms:
- No waiting room appears
- Users proceed directly
Solutions:
- Limited Inflow: Set to 0 for testing
- Segment activation: Ensure segment is activated
- Trigger rules: Verify URL matching rules
- Template settings: Check
data-nf-use-netfunnel-template="true"
Waiting Room Stuck (Never Ends)
Symptoms:
- Waiting room appears but never allows entry
- Infinite waiting
Solutions:
- Limited Inflow: Increase Limited Inflow value
- Segment status: Check if segment is in Block state
- Network issues: Verify network connectivity
- Server status: Check NetFUNNEL server status
Modal Not Appearing (Code-based)
Symptoms:
- Code-based integration shows no modal
- Page redirects instead
Solutions:
- Integration method: Ensure you're using code-based, not URL-triggered
- Function calls: Verify
nfStartis called correctly - Callback handling: Check callback is implemented
- Template settings: Ensure
data-nf-use-netfunnel-template="true"
Key Management Issues
Key Not Returned
Symptoms:
- Next users remain waiting indefinitely
- Queue doesn't progress
Solutions:
- Always call nfStop: Ensure
nfStop/nfStopSectionis called - Error handling: Return key even in error scenarios
- Timeout settings: Check segment timeout settings
- Function matching: Use identical keys for start/stop
// Always return key
try {
performAction();
nfStop(keys); // Success case
} catch (error) {
nfStop(keys); // Error case - still return key
}
Key Mismatch Errors
Symptoms:
- Server errors about invalid keys
- Key not found errors
Solutions:
- Key consistency: Use identical keys for start/stop functions
- Key scope: Don't reuse keys across different actions
- Timing: Don't call stop before start completes
// Correct: Same keys for start and stop
const keys = { projectKey: 'service_1', segmentKey: 'segKey_123' };
nfStart(keys, callback);
nfStop(keys);
Configuration Issues
Wrong Project/Segment Keys
Symptoms:
- Functions called but no effect
- Wrong segment behavior
Solutions:
- Console verification: Double-check keys in NetFUNNEL console
- Copy exactly: Copy keys exactly as shown in console
- Environment: Ensure using correct environment (prod vs staging)
Data Attributes Not Working
Symptoms:
- Configuration options not taking effect
- Unexpected behavior
Solutions:
- Attribute format: Use correct format (e.g.,
data-nf-timeout="5000") - Value ranges: Ensure values are within allowed ranges
- Method compatibility: Check if attribute applies to your integration method
Browser & Environment Issues
Ad Blocker Interference
Symptoms:
- Scripts blocked
- Network requests blocked
Solutions:
- Whitelist domains: Add NetFUNNEL domains to ad blocker whitelist
- User instructions: Provide instructions for users
- Fallback handling: Implement graceful degradation
Browser Compatibility
Symptoms:
- Functions not working in certain browsers
- JavaScript errors
Solutions:
- Browser support: Check browser compatibility
- Polyfills: Add necessary polyfills for older browsers
- Feature detection: Use feature detection before calling functions
Development vs Production
Symptoms:
- Works in development but not production
- Different behavior between environments
Solutions:
- Environment URLs: Use correct URLs for each environment
- Console configuration: Set up separate segments for dev/prod
- Caching: Clear browser cache and CDN cache
Getting Help
If you're still experiencing issues:
- Check console logs: Enable
data-nf-print-log="true"and check browser console - Verify configuration: Double-check all settings in NetFUNNEL console
- Test with simple setup: Start with basic configuration and add complexity gradually
- Contact support: Reach out to NetFUNNEL support with specific error details
Related Documentation
- Quickstart: Begin quickly
- Installation & Initialization: Basic setup guide
- URL-Triggered Integration: URL-based traffic control
- Code-based Integration: Function-based traffic control
- API Reference: Complete function specifications
- Initialization Option Reference: All available options