Skip to main content
Version: 4.6.1

Troubleshooting & FAQ

Common issues, solutions, and frequently asked questions for NetFUNNEL JavaScript Agent integration.


Table of Contents


Installation Issues

Agent Script Not Loading

Symptoms:

  • No netfunnel-javascript-agent.js in Network tab
  • HTTP 404 or other errors for agent file

Solutions:

  1. Check script URL: Verify the src URL is correct and accessible
  2. Network connectivity: Ensure your server can reach NetFUNNEL servers
  3. Ad blockers: Disable ad blockers that might block the script
  4. 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.json in Network tab
  • HTTP errors for settings file

Solutions:

  1. Check data-nf-client-id: Verify the client ID is correct
  2. Console access: Ensure you have proper access to NetFUNNEL console
  3. 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:

  1. Required attributes: Ensure data-nf-client-id is present
  2. Segment activation: Check segment is activated in console
  3. Limited Inflow: Verify Limited Inflow is not set to unlimited
  4. 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:

  1. 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');
}
  1. Script loading order: Ensure NetFUNNEL script loads before your code
  2. Wait for load: Call functions after window.load event
window.addEventListener('load', function() {
// Safe to call NetFUNNEL functions here
});

Callback Not Executing

Symptoms:

  • nfStart called but callback never fires
  • No response received

Solutions:

  1. Check network: Verify network requests to NetFUNNEL server
  2. Console logs: Enable data-nf-print-log="true" for debugging
  3. Segment status: Ensure segment is not in Block state
  4. Limited Inflow: Check if Limited Inflow allows entry

Network & Connection Issues

Network Timeout Errors

Symptoms:

  • NetworkError with status code 1002
  • Requests timing out

Solutions:

  1. Increase timeout: Set data-nf-network-timeout to higher value (max 10000ms)
  2. Retry configuration: Increase data-nf-retry-count
  3. 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:

  • NetworkError with status code 1001
  • No internet connectivity

Solutions:

  1. Check connectivity: Verify internet connection
  2. Firewall: Ensure NetFUNNEL domains are not blocked
  3. Proxy settings: Configure proxy if needed
  4. 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:

  1. Limited Inflow: Set to 0 for testing
  2. Segment activation: Ensure segment is activated
  3. Trigger rules: Verify URL matching rules
  4. 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:

  1. Limited Inflow: Increase Limited Inflow value
  2. Segment status: Check if segment is in Block state
  3. Network issues: Verify network connectivity
  4. Server status: Check NetFUNNEL server status

Symptoms:

  • Code-based integration shows no modal
  • Page redirects instead

Solutions:

  1. Integration method: Ensure you're using code-based, not URL-triggered
  2. Function calls: Verify nfStart is called correctly
  3. Callback handling: Check callback is implemented
  4. 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:

  1. Always call nfStop: Ensure nfStop/nfStopSection is called
  2. Error handling: Return key even in error scenarios
  3. Timeout settings: Check segment timeout settings
  4. 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:

  1. Key consistency: Use identical keys for start/stop functions
  2. Key scope: Don't reuse keys across different actions
  3. 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:

  1. Console verification: Double-check keys in NetFUNNEL console
  2. Copy exactly: Copy keys exactly as shown in console
  3. Environment: Ensure using correct environment (prod vs staging)

Data Attributes Not Working

Symptoms:

  • Configuration options not taking effect
  • Unexpected behavior

Solutions:

  1. Attribute format: Use correct format (e.g., data-nf-timeout="5000")
  2. Value ranges: Ensure values are within allowed ranges
  3. Method compatibility: Check if attribute applies to your integration method

Browser & Environment Issues

Ad Blocker Interference

Symptoms:

  • Scripts blocked
  • Network requests blocked

Solutions:

  1. Whitelist domains: Add NetFUNNEL domains to ad blocker whitelist
  2. User instructions: Provide instructions for users
  3. Fallback handling: Implement graceful degradation

Browser Compatibility

Symptoms:

  • Functions not working in certain browsers
  • JavaScript errors

Solutions:

  1. Browser support: Check browser compatibility
  2. Polyfills: Add necessary polyfills for older browsers
  3. Feature detection: Use feature detection before calling functions

Development vs Production

Symptoms:

  • Works in development but not production
  • Different behavior between environments

Solutions:

  1. Environment URLs: Use correct URLs for each environment
  2. Console configuration: Set up separate segments for dev/prod
  3. Caching: Clear browser cache and CDN cache

FAQ

Can I put the script in a common JS file?

A: Yes, you can dynamically insert the script:

<script src="./netfunnel.js" defer></script>
// netfunnel.js
var scriptNF = document.createElement("script");
scriptNF.setAttribute("data-nf-client-id", "your-client-id");
scriptNF.src = "https://agent-lib.stclab.com/agents/client/javascript/netfunnel-javascript-agent.js";
document.head.appendChild(scriptNF);

How should I handle NetworkError?

A: Notify the user and either retry nfStart or proceed with original logic:

function handleNetworkError(response) {
if (confirm('Network error occurred. Retry?')) {
nfStart(keys, callback); // Retry
} else {
performOriginalLogic(); // Proceed anyway
}
}

What if I forget to return the key?

A: The key may be auto-returned by server timeout, but this can cause bottlenecks. Always return explicitly:

// Good: Always return key
nfStart(keys, function(response) {
if (response.status === 'Success') {
performAction()
.then(() => nfStop(keys))
.catch(() => nfStop(keys)); // Even on error
}
});

Can I use both URL-triggered and code-based methods?

A: Yes, you can mix methods within a single service:

  • Use URL triggers for page-entry speed control
  • Use code-based for business concurrency control

However, to reduce operational complexity, it's recommended to prioritize one method.

How do I debug NetFUNNEL integration?

A: Enable logging and check the console:

<script
src="https://agent-lib.stclab.com/agents/client/javascript/netfunnel-javascript-agent.js"
data-nf-client-id="your-client-id"
data-nf-print-log="true"
></script>

Then check DevTools Console for NetFUNNEL log messages.

What's the difference between Basic Control and Section Control?

A:

  • Basic Control: Limits entry speed (how fast users can enter)
  • Section Control: Maintains fixed concurrent user count (how many users can be active simultaneously)

Use Basic Control for simple entry limiting, Section Control for maintaining specific concurrency levels.


Getting Help

If you're still experiencing issues:

  1. Check console logs: Enable data-nf-print-log="true" and check browser console
  2. Verify configuration: Double-check all settings in NetFUNNEL console
  3. Test with simple setup: Start with basic configuration and add complexity gradually
  4. Contact support: Reach out to NetFUNNEL support with specific error details