Trello Authorize cannot read properties of undefined error

Dear Trello Community,

I created a company web app that interfaces with Trello. The Web App acts as an entry point and captures data, which is then fed to the Trello API to create / update cards.

I am using the window.Trello.authorize() to receive authorization from the user to perform Trello actions on their behalf.

I followed this setup: Getting Started with client.js

The code works great in my local development environment. I was done with the build so the other day, I moved the code to our TEST environment which is a virtual Linux server. Now, I get the following error with window.Trello.authorizie():

App.js:480 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘authorize’)
at t.value (App.js:480)
at rn (react-dom.production.min.js:181)
at ln (react-dom.production.min.js:180)
at Uc (react-dom.production.min.js:261)
at $n (react-dom.production.min.js:230)
at Kn (react-dom.production.min.js:229)
at An (react-dom.production.min.js:223)
at react-dom.production.min.js:121
at t.unstable_runWithPriority (scheduler.production.min.js:18)
at Nt (react-dom.production.min.js:120)

I looked at the files on the TEST machine. index.html is setup correctly with the correct lines. The code is no different. I’ve been researching but nothing so far.

Do any of you have an idea? I appreciate any thoughts or advice you might have on this.


Ok community, on the TEST machine, I manually updated the index.html and moved the script tags. When I placed them above the “head” tag (right below “html” tag with no spaces, it worked. I then placed the “script” tags within the “head” right at the bottom and that worked too. I’m not sure what caused the scripts to not be loaded but by adjusting the location, they are getting loaded. Thanks!

Sounds like a classic issue of caching. By moving things around like that you “jiggled the handle” so-to-speak. But, glad it’s working for you!

Jrfischer, ahh, ok! I’ll keep that in mind next time I run into an issue like this. I appreciate the response.