Adding a library "AG-Grid" not working despite UMD

Hi, new to retool so might be missing a really simple thing.
I am trying to add AG-Grid in my custom component with React. I tried to directly import AG-Grid using CDNjs script tag. The component seems to be imported but it gives an gridOptions being undefined error.

Screenshot 2023-05-19 at 15.27.43

Here is the json for the app I am trying to use this in.
Hierarchical View.json (35.1 KB)

// This is the entrypoint for the React component.
const ConnectedComponent = Retool.connectReactComponent(MyCustomComponent)
const container = document.getElementById('react')
const root = ReactDOM.createRoot(container)
root.render()

Along with that I tried to import agGrid library by adding it to the libraries sections of scripts and styles for the app.
Screenshot 2023-05-19 at 15.25.29

I am unable to access agGrid any where in the app when trying to import this way. I have also checked that the minified umd I am using does not use require statements as specified here.

I would really like any help enabling using agGrid since I am looking for a solution to create hierarchical tables in retool. If there is any other solution for creating hierarchical tables. Please let me know.