-
Notifications
You must be signed in to change notification settings - Fork 7
Residential Parking Form (out of box Knack.js form embed) #271
Conversation
Providing a bit of an update here and also looping in @johnclary... The first thing I tried with the guidance of @ifsimicoded & @briaguya was to update our version of Babel to v7 because they now support a noConflict mode where the error I was seeing gets downgraded to just a console warning instead of breaking the runtime. For more discussion on that decision, see their Github. I also updated React-Static to v6 since they use babel v7. Neither of these updates changed the error I was seeing. I was able to get the Knack.js embed code working but only by disabling babel/polyfill altogether. This means, until we find a solution, the whole React-Static site would not be compatible with IE 11. I was able to do this a couple ways. One by removing it from our package.json dependencies entirely. Two, less extreme, by commeting out the code that adds babel/polyfill to the webpack configuration which happens here. Once I was able to get the embedded Knack code running locally, I wanted to try a few things to see if I could get the babel/polyfill back. I explored using the idempotent-babel-polyfill library, but that made no difference and the error reemerged. I believe this is because, at the end of the day, Knack's code is emitting the error and no matter what version of babel we use, their code includes a version of babel <7 so there will be always be a conflict. So, for demo purposes, we can proceed by leaving babel/polyfill removed from the site. But in order for this to be resolved, I think we have to get Knack to either update their code to use babel 7 which has the |
copy of message to Knack support:
|
thanks @mateoclarke. oof, this one's a bummer. i don't have a whole lot of hope for knack upgrading to babel v7, but hopefully they get back to us soon. looking forward to the demo site and let's discuss further. |
Response from Knack Support + my response:
|
|
I've started a new branch which doesn't change the versions of react-static or babel and focuses on small styling issues. Going to close out this issue in favor of #272 |
I've started trying to embed the Knack.js form/app for Residential Parking Permits ( https://atd.knack.com/parking ) in alpha. I thought it would be pretty straightforward since its just some 3rd party code and I followed the pattern that Simi set running the Recollect 3rd party js. Unfortunately I'm stuck on a bug and I'm looking for ideas...
Apparently the knack.js embed code is conflicting with React Static because it brings along an instance of babel/polyfill and React Static already has own instance. This error appears in the browser console and seems to prevent the script from executing:
k.js:1 Uncaught Error: only one instance of @babel/polyfill is allowed
idempotent-babel-polyfill
can run multiple instances. https://github.com/codejamninja/idempotent-babel-polyfill