I’m not certain this error is caused because of the amplitude integration, but I’m seeing other console errors like Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'e._q.push')
and Cannot load script https://cdn.amplitude.com/libs/analytics-browser-2.2.3-min.js.gz. Failed integrity metadata check. Content length: 64254, Expected content length: -1, Expected metadata ...
So my hunch is it is because of Amplitude
@peter alright it looks like the form is now loading correctly, but i’m still seeing a few console errors (that i think are related to amplitude still): Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'push') at index.js:2:1186066
I see that error every time I click next or back through the form. I’m assuming this is from the form trying to push an amplitude event but for some reason isnt able to
hmm, okay so fixing the version to https://cdn.jsdelivr.net/npm/@email@example.com/umd/index.js (and re-building my local and whatnot), I no longer see the Amplitude script install error, but I still see these errors, as well as it’s not rending the form at all now
I embedded your form via the JS SDK on that version into an empty html document and tested it out, everything seemed to work fine. I wonder if you have an existing amplitude installation that might somehow be colliding with our installation?
It’s difficult for us to reproduce the error on our side and right now it seems the issue is something elsewhere in your site may be confounding the feathery installation.
Given it works well in an empty HTML document, it’d be helpful to first figure out what in your environment is causing the form to error like that.
Peter we definitely will have an existing implementation of amplitude. However, I had thought Feathery would not try to instantiate amplitude if one was detected?
How are you detecting whether amplitude already has been initialized? What version of Amplitude are you using? We are on 2.3.2 of their analytics-browser and using npm/yarn to install it. No other integrations have had issues.
also, i noticed that in our local testing, there is an amplitude error thrown by your amplitude instance. Reason is that you need to set min_id_length: 1 to allow for max flexibility for integrations. by default they enforce min length of 5.
Hey Trevin, we just updated the min id length on our side to 1 in the latest version. We are using 2.3.2, but looking at the default amplitude installation code, it looks like it will only try to ignore instantiation if there already exists an amplitude object on window. This is created during the web installation but perhaps not during the npm install. we also use the window.amplitude API to track events on our side.
I’ve verified that in our web app, window.amplitude returns an object, so it is defined. I’m so confused why we are getting errors.
I’m looking at the repo and see this line:
where is the logic to detect if amplitude is already installed to skip this?
One thought: on a given form, in amplitude integration settings, should you just add in an option on whether you should initialize or not? I mean most products that use amplitude that embed a feathery form will always have initialized it.
We are still seeing the errors that @rachaelsweetman reported earlier.
I recorded this in jam.dev so you can see the console errors. It shows the fact that our instance of amplitude SDK is instantiated correctly, and we fired an event when our page loads, but the events originating from Feathery are not fired (hence the console errors). It really does seems like something is wrong within the feathery code on this one.
in the amplitude installation code, you’ll see the line to check if (r.invoked). If the amplitude library is already installed, it won’t progress beyond that line. However, I did notice that the amplitude.init call will still be invoked in that case, so I made a change in the latest version (2.0.132) so that it is no longer invoked – try that out? Other than that, you can see the function calls we make to amplitude within the library – feel free to let us know if you see any issues there.
It’s hard for us to debug fully because we aren’t able to reproduce the issue on our side since your hosted form appears to be working well