Closed cmoel closed 8 months ago
I don't have a great answer for you other than to downgrade to importmap-rails ~> 1
unfortunately the decision to always vendor broke a number of packages.
https://github.com/rails/importmap-rails/pull/217
There is a fully bundled version here:
https://unpkg.com/browse/rhino-editor@0.9.1/cdn/exports/index.js
you could try. I think it would be something like:
bin/importmap pin rhino-editor/cdn/exports/index.js
Thanks for the help. Before opening this issue I tried using unpkg (with bin/importmap pin rhino-editor --from unpkg
) on version 2 of importmap-rails
and ran into 404s when looking for the chunks referenced in that bundled file because the chunk files weren't vendored.
For now, downgrading to version 1 of importmap-rails
unblocks me. Thanks again!
@cmoel did you run into this error in the browser console? I downgraded importmaps-rails to v1 so I could run bin/importmap pin rhino-editor
, but can't seem to get past this:
TypeError: Module name, 'rhino-editor/exports/styles/trix.css' does not resolve to a valid URL.
My application.js
file contains these relevant lines:
import "rhino-editor"
import "rhino-editor/exports/styles/trix.css"
Thanks for opening this issue -- helped get me unstuck with the first bit!
@moneill importmaps don't support importing CSS.
you'll need to add a <link>
tag in your <head>
pointing to the CSS file.
<link rel="stylesheet" href="https://ga.jspm.io/npm:rhino-editor@0.9/exports/styles/trix.css">
I added some docs here:
https://rhino-editor.vercel.app/tutorials/getting-started/#manual-importmaps-installation
I'm trying to add Rhino Editor to a Rails 7.1 app using
importmap-rails
v2.0.1. After runningbin/importmap pin rhino-editor
, I see the following error when pinninglit-html/
:Curling the 404ing URL confirms that there's a 404:
Installing
lit
by itself works fine:I'm not sure what the next troubleshooting step would be. Can you provide some guidance?