shadow-cljs

Yaw Odame 2025-03-09T17:27:14.110239Z

Hi all. I very certain this is not a shadow issue but more to do with manner in which I am building a release for an expo react native app. In my case, expo fails during my preview profile build, but succeeds with a development profile build. Error:

yarn run v1.22.21
$ /Users/expo/workingdir/build/mobile_app/node_modules/.bin/expo export:embed --eager --platform ios --dev false
ConfigError: Cannot resolve entry file: The main field defined in your package.json points to an unresolvable or non-existent path.
error Command failed with exit code 1.
info Visit  for documentation about this command.
yarn expo export:embed --eager --platform ios --dev false exited with non-zero code: 1
The preview build is not able to resolve the entry file shadow builds (app/index.js). The path in present in my package.json. Wondering if others have come across a similar issue?

thheller 2025-03-09T19:44:45.282219Z

what is your build config? Don't know anything about this error, but seems very clear? does the file actually exist?

Yaw Odame 2025-03-09T19:48:19.080359Z

{:target     :react-native
                       :init-fn    app.property-pro.client/init
                       :output-dir "mobile_app/dev"
                       :dev        {:closure-defines  {'goog.DEBUG                               true
                                                       app.property-pro.client/SERVER_URL ""}
                                    :compiler-options {:external-config {:guardrails {:emit-spec? true :throw? false}}
                                                       :pretty-print    true}}
                       :release    {:output-dir "mobile_app/app"
                                    :closure-defines  {'goog.DEBUG                               false
                                                       app.property-pro.client/SERVER_URL ""}
                                    :compiler-options {:optimizations     :advanced
                                                       :infer-externs     :auto
                                                       ;:variable-renaming :off
                                                       ;:property-renaming :off
                                                       :pretty-print      false
                                                       :source-map        true}}
                       :js-options {:js-package-dirs ["mobile_app/node_modules" "mobile_app/components"]
                                    :resolve
                                    {;; Make js-joda-timezone a more reasonable build size
                                     "@js-joda/timezone"
                                     {:target  :npm
                                      :require "@js-joda/timezone/dist/js-joda-timezone-10-year-range.min.js"}}}
                       :devtools   {:autoload        true
                                    :reload-strategy :full
                                    ;:after-load      app.property-pro.client/start
                                    :preloads        [shadow.expo.keep-awake
                                                      com.fulcrologic.devtools.electron-preload]}}
Also trying out an idea. According to expo, eas builds upload your project files to the expo server. Files in your gitignore file are not uploaded. This might explain the error about it not being able to find the entry file.

thheller 2025-03-09T19:50:22.935029Z

I never deployed anything with expo, so not sure how that works

thheller 2025-03-09T19:50:54.017079Z

config looks fine

Yaw Odame 2025-03-09T19:53:13.828379Z

Yup. I am certain this has to do with the fact that I am ignoring the entire /app directory. I did that because shadow compiles a bunch of js files during development.

Yaw Odame 2025-03-09T19:53:30.831259Z

Will report back when I find a solution. Cheers!

Yaw Odame 2025-03-09T19:56:07.274639Z

In the meantime. Do you have a clue as to how to resolve these warnings during shadow release?

shadow-cljs - connected to server
[:main] Compiling ...
------ WARNING #1 -  -----------------------------------------------------------
 Resource: 
 unknown @define variable _SINGLEQUOTE_goog.DEBUG
--------------------------------------------------------------------------------
------ WARNING #2 -  -----------------------------------------------------------
 File: ~/.m2/repository/com/fulcrologic/fulcro-rad/1.6.10/fulcro-rad-1.6.10.jar!/com/fulcrologic/rad/type_support/js_joda_base.cljs:7:6
--------------------------------------------------------------------------------
   4 |   (:require
   5 |     ["@js-joda/core" :as js-joda]))
   6 | 
   7 | (set! js/JSJoda js-joda)
------------^-------------------------------------------------------------------
 constant JSJoda assigned a value more than once.
Original definition at externs.shadow.js:6
--------------------------------------------------------------------------------
   8 | 
--------------------------------------------------------------------------------
nil

thheller 2025-03-09T19:56:56.383199Z

{'goog.DEBUG                               false
                                                       app.property-pro.client/SERVER_URL ""}

thheller 2025-03-09T19:57:05.401259Z

remove the '

✅ 1
thheller 2025-03-09T19:57:19.329119Z

or rather remove goog.DEBUG entirely, because that is already set by default

thheller 2025-03-09T19:58:37.881359Z

unsure about the second

Yaw Odame 2025-03-10T14:30:31.021829Z

@thheller I was able to get a working eas preview build. From what I can tell expo's eas uses metro JS bundler to do some bundling magic during the build. It works when using shadow compile code, but not with shadow release code (single index.js entry). This is still not idle because I am building with dev code.

thheller 2025-03-10T17:03:28.510619Z

what is the issue with release code?

Yaw Odame 2025-03-18T17:59:07.189159Z

There's nothing wrong with the release code. This was all user error on my part. By default, Expo ignores all files and directories in your .gitignore file. I was ignoring the app/ directory to avoid committing dev JS builds. EAS for whatever reason ignores all app/ directories. So it ignored my src/main/*app*/... files as well. The simple fix - I set git ignore to only top-level app directory.