figwheel-main

raspasov 2021-09-27T06:41:14.063400Z

@nick.romer Sounds like a local IP issue, try setting something like

{:ring-server-options {:port 9500 :host "192.168.1.62 (your local network IP here)"}}
… in the figwheel-main.edn

raspasov 2021-10-06T06:06:33.065800Z

Unfortunately I don’t think figwheel does that automatically in the case of React Native. I ended up modifying the :advanced output manually after compilation.

raspasov 2021-10-06T06:07:28.066Z

Remove the code that looks something like:

module.exports = { renderFn: ar.main.figwheel_rn_root };

raspasov 2021-10-06T06:08:18.066200Z

… And make sure that the application has a way to start when in production mode. There might be a better/automatic way to do this but I haven’t investigated.

niveauverleih 2021-10-04T21:10:19.064800Z

Hi @raspasov, I actually don't understand the link between a ring server and a mobile app. I thought ring servers were for web apps?

niveauverleih 2021-10-05T04:53:58.065300Z

OK, thank you @raspasov! I learned something about figwheel. I really appreciate you answering me and I hope you hang on a little more. My problem is not during the dev phase; I can repl into figwheel just fine and expo web (the mobile phone emulator running in a browser) shows me the correct mobile app behaviour. My problem arises when I want to compile my app for prod release in order to create an installable Android apk. My assumption is that figwheel should remove itself from the code during a prod compile. Am I right?

niveauverleih 2021-09-27T06:54:38.064Z

Thank you ! I'll try that.

👌 1
raspasov 2021-09-27T06:42:40.063800Z

That is, the local network IP of your laptop/computer, not the phone/device.

niveauverleih 2021-09-29T21:19:12.064400Z

Hi @raspasov, that didn't help. I'm trying to take a step back and understand the fundamentals. I ran a prod build like so: clojure -m figwheel.main -O advanced -bo android and tried to visualizer it with expo start -w. Is that legit? The problem with that is that the compiled main.js is not copied to the project root as index.js. Therefore I modified package.json: `{ "main": "target/public/cljs-out/android/main.js",` Again, I'm not sure if that's the right way to do it. In any case, after this modification expo start -w compiles without errors, however there is an error on the browser based emulator: ReferenceError: fig is not defined pointing to this line in the code : module.exports = { renderFn: fig.main.figwheel_rn_root }; My goal is to get a functioning apk that runs on my phone. I'm grateful or any help I can get.