JavaScript error in Widgets-JS on websites using FastDOM 1.0 (with JSFiddle demo!)



Twitter’s widgets-js script throws an error if the website uses FastDOM 1.0:

widgets.js:8 Uncaught (in promise) TypeError: u.write is not a function(…)

JSFiddle demo:

Twitter’s widgets-js checks whether window.fastdom exists. If it does not exist then widgets-js injects its own copy of FastDOM 0.x and everything is fine. However, if window.fastdom does exist then widgets-js uses it assuming that the FastDOM version is 0.x and not the current version 1.0 (which has a completely different API). This is where things break.

For example, and fastdom.write have been renamed to fastdom.measure and fastdom.mutate in FastDOM 1.0. Furthermore, fastdom.defer has been removed.


Thank you for your report. We acknowledge the issue and are working on a solution with FastDom.


For reference, a link to the FastDOM bug report:


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.