Closed rapito closed 2 years ago
I think this is a problem with the way you're integrating rails-erb-loader. This is just transpiles ERB. Everything else is handled by your webpack config.
Hmmm, Thanks. I'm using the default configuration provided on this github. I'll try reaching the react-rails repo maintainers then.
@rhys-vdw and anyone interested, The issue was that I needed to add both
extensions:
- .jsx.erb
- .erb
to the webpacker.yml
file.
Maybe this shoud be documented somewhere?
I've never used webpacker before, maybe you can bring this up in their issue tracker @rapito?
Yeah, you are right. Thanks!
Version: 5.5.2
Having a component like this:
filename:
MyComponent.jsx.erb
makes rails-erb-loader ends up mapping it like this when webpacker compiles it:
The expected output is, which is how it looks if the file name was
MyComponent.jsx
:These results in not being able to find the component when trying to do
react_component 'MyComponent'