Problem using epubjs

I’m trying to use the epubjs library with rails (using importmaps), but I’m getting this error. And I don’t know if I’m doing something wrong or this package is somehow incompatible with importmaps.

This is the error I’m getting:

Those js files are getting 404.

The app setup is super basic. I just did:

  1. rails new epubjs
  2. bin/rails g controller home page
  3. bin/importmap pin epubjs - which pin some dependencies to vendor and other to the cdn.
  4. Added root pointing to home#page
  5. Added a import for epubjs on app/javascript/controllers/hello_controller.js file.

(I setup a repro here: GitHub - dimas-cyriaco/rails_epubjs)

Then, when acessing the home page, I get this errors.

I’m thinking maybe I have to use a bundler to use epubjs? I would like to avoid using a bundler…