js-api-samples
js-api-samples copied to clipboard
React Error at Initializing: tableau.viz is not a constructor
Hi,
I have been trying [email protected] and everytime I create a viz
object out of tableau
I run into the following error,
tableau.viz is not a constructor
Question also listed on this link.
Is this a problem with this specific version? Or is there a bug or something wrong with the code?
In the given code, you use:
viz = new tableau.Viz(url)
However, the specification of tableau.Viz()
function takes domNode
, url
and optionally options
as its arguments and in that order. Since there is no function named tableau.Viz
that takes url
as its only argument, it shows as error.
Try using window.tableau.Viz(*)
Also, ensuring that tableau was loaded using NextJS's <Script/> tag and which only triggered tableau-related functions after it was done loading helped me.
bulk closing