nicklandgrebe / active-resource.js

ActiveResource.js - API resource relational mapping in JavaScript
https://active-resource.js.org
MIT License
133 stars 20 forks source link

Uncaught TypeError: Cannot read property 'charAt' of undefined #46

Closed CharlieIGG closed 5 years ago

CharlieIGG commented 5 years ago

Hi all!

This library works perfectly for me on a dev environment, but once I deploy to Heroku all I get is: Uncaught TypeError: Cannot read property 'charAt' of undefined

A problem is that on the backtrace I get in the console, all of the files are somehow blank (?), so I'm not sure what's going on, other than the fact that createResourceLibrary and snake-case are involved in the backtrace.

For more context, I am using Webpack, and this is deployed on top of a Rails application using Webpacker.

Any ideas what's going on?

CharlieIGG commented 5 years ago

For reference, if you're seeing this issue, you forgot to set the API url when creating the resource library (happens if you delegate the URL to an ENV variable).