The highlighted source code line in pre_run_jquery is " r.send(i.hasContent && i.data || null)" which is part of the try/catch:
try {
r.send(i.hasContent && i.data || null)
} catch (e) {
if (o)
throw e
}
I have tested to find this both on a blank new page as well as in completely separate app. This does not stop app execution, but is obviously a concern.
Sounds like a plugin might be loading something globally on each of your app’s pages. Check each plugin at the bottom of each list of actions/elements and see if you see this
This is a great suggestion and I do have plugin(s) adding to the header, but the trick is figuring out which one is the problem. If I understand correctly, if I were to uninstall each one to do process of elimination I’d wreck all the actions using them in my app.
After conducting a stack trace, the code snippet seems part of a larger JavaScript framework or library being used in the application. It includes an initialization function that sets up periodic actions (heartbeats) and listens to changes in user authentication state, potentially among other things. Key parts:
This section sets up a heartbeat function that sends a POST request to server://user/hi every 300,000 milliseconds (5 minutes) using setInterval.
The heartbeat function is initially invoked if this.heartbeat_interval is null, suggesting it’s meant to run periodically only if not already set up.
The POST request uses a custom protocol (server://), which seems internally handled by the lib_default().location.post method. This could be part of a framework or library abstraction over the actual network requests, translating these requests to actual HTTP requests to the server.
User State Watching and Actions
u_exports2.Watcher(()=>{
// Code omitted for brevity
}).on_value(v=>{
// Code omitted for brevity
})
This section sets up a watcher that tracks certain values (presumably user state and page parameters) and performs actions based on those values.
It includes logic for handling user login state, potentially wiping certain data when no user is detected, emitting an event on cookie opt-in, and handling redirect logic based on query parameters if the user is logged in.
Issue with POST Request to user/hi
Given the error message about a 404 Not Found for a POST request to https://domain.bubbleapps.io/version-test/user/hi, it’s likely that this part of the code:
is where the problematic request originates. It seems the system is attempting to send a heartbeat or keep-alive signal to the server. It is either translating the custom protocol incorrectly to an actual HTTP request, or the server endpoint (/user/hi) doesn’t exist or is not correctly configured in the testing environment.
Hopefully, the above analysis can assist the bubble development team in resolving this.
Yeah, I was seeing it too, Rob, but only in my test versions. I confirmed it across several apps. I submitted a bug report earlier today, and it actually seems to be resolved now. At least I’m no longer seeing the error.