Logging to console?
philperrin opened this issue ยท 5 comments
Hey there, I'm having trouble logging to console using the code provided:
tableau.extensions.initializeAsync().then(() => {
console.log('I have been initialized!!')
});
Glitch indicates that 'tableau' is not defined.
Chrome's console just reads "Uncaught TypeError: document.registerElement is not a function"
This is after I've 'fixed' the Asynch bug and reloaded. Any thoughts? Thanks!
Hi Phil,
Glitch error is "normal". Glitch doesn't run your entire project when you are working on your code, tableau is defined in the Tableau Extensions API library. Just bee sure that you added: <script src="https://cdn.jsdelivr.net/gh/tableau/extensions-api/lib/tableau.extensions.1.latest.js"></script>
in the index.html before
For the second error, did you drag and drop the extension in the dashboard and you have this error?
You can get rid of that warning by adding /* global tableau */
to the top of your js file! ๐
Ok. Thank you. I'll play around with it a bit more.
Here is the code on glitch: https://glitch.com/edit/#!/platinum-changeable-lettuce
Here is a loom of me running it and not getting the log: https://www.loom.com/share/47085e3d931c411cb7d11d802104ff77
THANK YOU for a great webinar today and for making this!!
From your video it looks like you are using Chrome 80, the debugger won't work in this version, unfortunately. You shouldn't have to open the developer tools separately it should take up the whole page when working correctly. Download Chrome 79 and just double click the .exe
file then go to the debugger page in it and try again. https://tableau.github.io/extensions-api/docs/trex_debugging.html#download-the-chromium-browser