Fork me on GitHub

I've got problems with the react-native bundle process timing out, as it seem to do when a clojurescript project gets large enough. I'm using advanced compilation and I'm trying to use expo (thanks @seantempesta for the template!) I tried @pesterhazy's re-natal-husk approach and I got that to output a bundle(yay), but now I couldn't figure out how to use the re-natal-husk approach with exp publish? If I understand the exp/expo code correctly, it calls the bundler for me so I can't do the husk dance. Next up, I attempted Austin Birch approach ( It's now a bit outdated, so I updated the patch to the metro-bundler ( but I couldn't get the transformer to work without the bundler exiting with a non-descriptive error message: "map is not defined". My plan was to configure the bundle call to use this custom transformer and the patched metro-bundler, so that it'd work with exp publish. Wasn't able to see this plan through. Does anyone have any advice on avoiding the metro-bundler from timing out?


I haven't managed to get any of the tricks to work, the only thing that's worked for me to get the damn thing to build at all is finding the timeout interval that's hardcoded in the metro bundler and making it bigger


I wish there was another way 😬


Anyone else seeing this error with re-natal? Error: Cannot find module '@cljs-oss/module-deps


Trying to use npm-deps?


No, I’m just trying to get the initial app to run


➜  slide lein figwheel ios
Figwheel: Cutting some fruit, just a sec ...
Figwheel: Validating the configuration found in project.clj
Figwheel: Configuration Valid :)
Figwheel: Starting server at 
Figwheel: Watching build - ios
Compiling "target/ios/not-used.js" from ["src" "env/dev"]...
    throw err;

Error: Cannot find module '@cljs-oss/module-deps'
    at Function.Module._resolveFilename (module.js:489:15)
    at Function.Module._load (module.js:439:25)
    at Module.require (module.js:517:17)
    at require (internal/module.js:11:18)
    at [eval]:3:13
    at ContextifyScript.Script.runInThisContext (vm.js:44:33)
    at Object.runInThisContext (vm.js:116:38)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:573:30)
    at evalScript (bootstrap_node.js:452:27)

Successfully compiled "target/ios/not-used.js" in 23.99 seconds.
Launching ClojureScript REPL for build: ios
Figwheel Controls:
          (stop-autobuild)                ;; stops Figwheel autobuilder
          (start-autobuild [id ...])      ;; starts autobuilder focused on optional ids
          (switch-to-build id ...)        ;; switches autobuilder to different build
          (reset-autobuild)               ;; stops, cleans, and starts autobuilder
          (reload-config)                 ;; reloads build config and resets autobuild
          (build-once [id ...])           ;; builds source one time
          (clean-builds [id ..])          ;; deletes compiled cljs target files
          (print-config [id ...])         ;; prints out build configurations
          (fig-status)                    ;; displays current state of system
          (figwheel.client/set-autoload false)    ;; will turn autoloading off
          (figwheel.client/set-repl-pprint false) ;; will turn pretty printing off
  Switch REPL build focus:
          :cljs/quit                      ;; allows you to switch REPL to another build
    Docs: (doc function-name-here)
    Exit: Control+C or :cljs/quit
 Results: Stored in vars *1, *2, *3, *e holds last exception object
Prompt will show when Figwheel connects to your application


Ok, yeah the compiler probably found your node_modules folder and tried to include those deps.


What should I do?


Try with an older version of cljs


Or a newer one if this is a bug


This is the latest one


Well you can try to add @cljs-oss/module-deps it to your package.json with yarn or npm


yarn add or npm i


Or try asking in the #cljs channel, @U061V0GG2 or @U0CK4CKAP will be able to help you probably


Cool thanks


hey @petterik. Glad you’re liking the expo template. I haven’t used @pesterhazy’s template yet (but it looks very interesting), so I can’t comment directly. Have you tried asking in the Expo slack? I’ve been getting along fine with the simple timeout hack (edit node_modules/metro-bundler/src/JSTransformer/index.js and extend the timeout by adding a couple of zeros)

// Worker will timeout if one of the callers timeout.


mm yeah I do the same


would be awesome if there was a way of skipping the transform and minify steps


cos google closure does that already


but I can't figure out how


Yeah, especially now that npm deps is becoming a thing


in cljs that is


The ideal thing would be to replace the babel step of the packager but let it do the rest of its magic


Is that possible via the babel configuration file? Babel seems like it’s got a million levers. Certainly one of them would let you tell it to skip the transform/minification process for the clojurescript file. I’m totally fine with putting my react requires in a separate file.


I’ve tried to do it but failed. I was only successful when I compiled everything into a blob and overwrote with that file. The problem then is that npm-deps has to be processed by the Closure compiler rather than the RN packager


But that is theoretically possible. There is even a hook in the cljs compiler where we could compile external deps with babel (since Google Closure won’t handle JSX for example).


Ideally those external deps would be cached


Hi! I'm having a problem with react-navigation. I have this structure

- Home
   --Tab A (First screen)
   --Tab B 
I would like from Home go to Tab B. Now I can go only to Tab A . How I can make it work? Thx 🙂


You nest a TabNnavigator in the StackNavigator, right?


I'd assume the way to do is to pass a parameter along with a route which tab should be the start one and pass it down to tabnavigator


Or check this parameter inside the component that you render in the componentWillMount and set the proper tab as starting one


ah ok so I can just change the initial-route of the tab navigator?


> initialRouteName - The routeName for the initial tab route when first loading


great I didn't think about this solution 🙂


Good luck 😉 🤞


thanks 😄


@danieleneal, @seantempesta holy shit, it worked! Finished building JavaScript bundle in 1416705ms. I tried it yesterday and gave up 🙃 I'll still ask in the expo slack to see if there's anything they're willing to do for us clojurescript folks


hahaha yeah I couldn't believe it the first time


it takes an aaaaaage


the expo slack is a bit question heavy and no answers I've found


but you could put a forum post up


@danieleneal which forum do you have in mind? Is there an expo forum?


I've been stuck on this (on and off) for 2 months


Never been so happy looking at a green text 😆


Is there a way to skip bundling the android bundle for exp publish?


In case someone is curious how long it can take for the bundling process to finish: My main.js is 1,518,693 bytes compiled with :advanced optimizations. 23 minutes to build my iOS bundle 17 minutes to build my android bundle


That’s not awesome


What kind of a performance improvement do you get from advanced?


I haven't built the UI yet so I don't know. Brought in all the logic from our web app to see if we can build a mobile app from it


@vikeri What are you using for "production build" if not advanced optimizations, and how long does it take for you to bundle your apps?


@petterik It’s a bit of a frankenstein, we’re using the base of boot-react-native but customized to exclude things like repl and live-reload… But basically it’s just all the files compiled normally with cljs and then fed to the RN packager. It takes us 7 minutes to build all cljs and then the app from a clean slate.


I’d love to do advanced but can’t really prioritize it atm


@petterik glad the worked. It also takes me 15-20 mins per build. Ugh. We definitely need a better solution so please let me know if you hear back from the Expo team on a workaround.


I've got an expo forum post ready, but a new user I can only post 2 links and it has 6. Waiting until the new user status goes away.


So ridiculous, it's not like the packager is doing anything in those 20 minutes