Closed Atelier-Mirai closed 1 year ago
I'm trying to use Ruby2JS as well, and for me the error described above disappeared after I added gem "ruby2js"
to my Gemfile and ran bundle
. Now my site builds without errors, but the <hello-world>
element is empty on the page where I put it, and I'm seeing this error in the browser console:
Uncaught ReferenceError: custom_elements is not defined
rb hello_world.js.rb:9
__require index.HFLECBSA.js:11
<anonymous> *.{js,jsx,js.rb,css}:2
<anonymous> index.HFLECBSA.js:5356
All of the above are the same whether I'm on 1.2 or 1.3 beta1, and the error is the same regardless of browser (I tried Firefox 112.0.1 and Chrome 112.0.5615.165).
The only similar issue that I could find was one raised by @Atelier-Mirai: https://discord.com/channels/711236503493148733/901191662464819201/1087317406583631912
On second glance, these seem like separate issues. I'd be happy to copy my message above into a new issue if that would be more appropriate.
@fpsvogel Thanks for pointing that out…it is indeed all the same issue. There's just a whole new configuration method which the latest esbuild plugin + gem is going to require. If you follow these instructions to add a config file, then it should work. We'll make sure the automation installs that automatically.
@jaredcwhite Thank you! I added a config file and now it's working.
Thank you for releasing Bridgetown 1.3.0 beta1. I tried to see if it would work with Ruby2JS. It does not seem to work.
Bridgetown Version:
bridgetown 1.3.0.beta1 "Kelly Butte"
To Reproduce
Here are the steps I took.
I accessed localhost:4000 and saw index.md.
Next, the following commands were executed. docs
A new file
src/_components/hello_world.js.rb
was created, which contained the followingSo we added the following to index.md
<hello-world></hello-world>
Current behavior
I accessed localhost:4000 again and looked at index.md, no change.
Expected behavior
I was expecting the code to show up as
<p><strong>Hello World!</strong></p>
since it is written asself.inner_html = "<p><strong>Hello World!</strong></p>"
.Screenshots
The following is the output to the terminal.
It does not seem to be working because an error is displayed.
I know this is a lot of work for you, but I would be very happy if you could improve it.
Computing environment (please complete the following information):
Additional context