Fork me on GitHub
#figwheel-main
<
2021-09-27
>
raspasov06:09:14

@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

niveauverleih06:09:38

Thank you ! I'll try that.

👌 1
niveauverleih21:10:19

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

niveauverleih04:10:58

OK, thank you @U050KSS8M! 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?

raspasov06:10:33

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.

raspasov06:10:28

Remove the code that looks something like:

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

raspasov06:10:18

… 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.

raspasov06:09:40

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

niveauverleih21:09:12

Hi @U050KSS8M, 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.