tableau / datadev-hackathon

Resources and materials for Tableau #DataDev hackathons.
MIT License
17 stars 12 forks source link

Logging to console? #1

Closed philperrin closed 4 years ago

philperrin commented 4 years ago

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. image

Chrome's console just reads "Uncaught TypeError: document.registerElement is not a function" image

This is after I've 'fixed' the Asynch bug and reloaded. Any thoughts? Thanks!

illonage commented 4 years ago

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: in the index.html before

For the second error, did you drag and drop the extension in the dashboard and you have this error?

KeshiaRose commented 4 years ago

You can get rid of that warning by adding /* global tableau */ to the top of your js file! 🙂

philperrin commented 4 years ago

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!!

KeshiaRose commented 4 years ago

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

philperrin commented 4 years ago

It's alive! image

All set now - THANK YOU!