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?what is your build config? Don't know anything about this error, but seems very clear? does the file actually exist?
{: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.I never deployed anything with expo, so not sure how that works
config looks fine
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.
Will report back when I find a solution. Cheers!
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{'goog.DEBUG false
app.property-pro.client/SERVER_URL ""} remove the '
or rather remove goog.DEBUG entirely, because that is already set by default
unsure about the second
@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.
what is the issue with release code?
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.