Recompiling JSX?

Made a stupid mistake, put a console.log directive in JSX and forgot the JSON.stringify. So I get a log which basically says [object Object].

Sigh. I go back and fix the code. Look at console again.

[object Object]

I try tweaking the message to see if the code is being rebuilt. NOPE!
So okay: I try every asset recompilation directive I can THINK OF to try and get the JSX to rebuild again. All the react_on_rails ones. NOPE! assets:clobber | assets:recompile. NOPE! Still using the same precompiled code it got wrong.

And since it isn’t in the documentation how to do that, I’m stumped.

We’re still on 6.1.1. I’m trying to just get my code to work. Can someone tell me which rake task will actually clobber and rebuild JSXs so that you can make code changes and they work?

I should guess about your setup. It is a react_on_rails (which version) project using Shakapacker 6.1.1? and how are you running webpack? bin/webpacker? bin/webpacker-dev-server? Using

If you are running dev-server, you changes should get bundled again. Doesn’t matter what change you make.

In the worst case, you can remove the bundled files in the public directory (check config/webpacker.yml for the right path`.

Please improve

  • the formatting of the post.
  • the setup detail

And consider upgrading to the latest version for better support.