-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.7.1 Event post produces wrong URL #117
Comments
Can I see the code where you initialize your client? It looks to me like On the other question: the package that's published on NPM includes minified code. If you're not using NPM, I think your best bet would be to just pull the 2.6.0 tag from Github and build it with |
The initialization part of the code was fine in terms of the values we provided, but we had some other issues; " Fixed it by using the require1k library: • Remove the script import we had • Load our startup script with • And at the top of it, define |
Nevermind, it's still not working when deployed. Same error as before: 404 Not found on a POST to
In the bundled and deployed code, we have this function to arrange the initialization
Which for me when called and debugged uses the values:
|
So - you're not passing any custom values at all for those URL properties. In that case I have absolutely no idea how the LD client is ending up with functions where there should be strings. Looking at the code, I just don't see how it is possible. I mean, here is where it's setting the base URL for events, and here is where it's constructing the full URL that it posts to. It should be pretty straightforward. Of the two function objects that have somehow ended up in your URL, the first one - which should be the base URL from my first link - just says "native code", so who knows; the second one looks like a minified version of the I can't say I've ever seen anything like this. |
9. remove remaining reference to window.EventSource in common code
Closing this as we have had no update from the requester since late 2018. |
On a remote server, on initialization, LD client calls
https://ourhostname.com/function%20()%20%7B%20[native%20code]%20%7D/events/bulk/function%20n(r)%7Bvar%20o=new%20XMLHttpRequest;return%20o.open(%22POST%22,e+%22/events/bulk/%22+n,!t),h(o),o.setRequestHeader(%22Content-Type%22,%22application/json%22),o.setRequestHeader(%22X-LaunchDarkly-Event-Schema%22,%223%22),t%7C%7C(o.addEventListener(%22load%22,function()%7B400%3C=o.status&&s(o.status)&&r?n(!1).send(u):e(function(e){var%20n={status:e.status},t=e.getResponseHeader(%22Date%22);if(t){var%20r=Date.parse(t);r&&(n.serverTime=r)}return%20n}(o))}),r&&o.addEventListener(%22error%22,function(){n(!1).send(u)})),o}
and on localhost it calls:
https://localhost:1338/[object%20Object],[object%20Object]/events/bulk/true}
.I've tracked
events/bulk
down toEventSender.js
which through intermediaries is used byinitialize
inindex.js
.Not sure how to fix it though. We haven't changed any code on our end, and the arguments going into our call to
.initialize
seems correct.It's possible that this is related to es5-es6 polyfills because our solution has many silently caught errors relating to es6 functions.
Separate question for a workaround of using v2.6.0:
For this project we are unfortunately using Bower (Polymer 2), with the URL for "ldclient.min" being
https://app.launchdarkly.com/snippet/ldclient.min.js
.Without some cumbersome workaround it seems we're locked to your latest version with that URL. Any easy way you know of getting a minified 2.6.0?
If you had had minified builds in the published source, we could have deep linked to v2.6.0 and probably been fine, but as it is, the only CDN I can find is at
https://cdn.jsdelivr.net/npm/ldclient-js@2.6.0/dist/ldclient.cjs.min.js
which breaks at the@
in Bower, yieldingbower ldclient.min#* install ldclient.min#e-tag:W/"5769-9e
The text was updated successfully, but these errors were encountered: