font-picker
font-picker copied to clipboard
Uncaught TypeError: Cannot read property 'pickerId' of undefined
Hi, so i am using the font-picker via JSDelivr CDN and i have followed all the instructions, i have a div with "font-picker" id, but I keep getting an error on the page-
I am not sure what it is that I am doing wrong...
I know this is a bit of an old post at this point, but I came across the same problem recently when I was trying to use the JSDelivr CDN too and I think that it has a bugged or older version of the script somehow. So I'd download and self-host if you could and if you're unsure how to compile everything I'd recommend using the compiled 3.5.1 script in ogallagher's post here. I can personally confirm that the dist-browser variant works beautifully and solved the errors that I was getting with the JSDelivr CDN. Hope that helps!
You need to enable Web Fonts Developer API.
- Go to https://console.developers.google.com/projectselector/apis/credentials
- Select a project or start a new project
- On the left side of the screen go to ‘Credentials’ tab and choose ‘API key’, then choose ‘Browser key’, give it a name and press ‘Create’.
- Copy the given API key
- From the left side of the screen go to ‘Overview’, in the ‘Other popular APIs’ section choose the ‘Web Fonts Developer API’.
- Press ‘Enable API’.