-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IOS] MiniApp.jsbundle not updated #698
Comments
Hi @jomnius, You shouldn't have to run What For example, let's say in the Cauldron, for
Then no matter, how many times you run Only way to reflect latest code changes of these MiniApps is to bump their versions, publish new versions, and update the versions to use in the Container (ultimately MiniApp.jsbundle) through Another way is also to use git branch for MiniApp versions (this is useful for generating dev containers on CI mostly), in that case, instead of specifying npm registry path (with versions) for the MiniApps, you can use git repo path with branch, for example :
This way, whenever you run So for dev, that's how you can do it to simplify things and ensure that dev containers will always have the latest changes from the miniapps. Then at the time of release, and only at the time of release should you use Cauldron (I mean, you can use it for dev as well, but as we've seen it's not the more convenient thing). What we do at the time of release (let's say version 17.8.0 of our native app) is that we tag all of the miniapps repos (this is CI scripted as well) with native-app-name-android-17.8.0 and then we create the native application version 17.8.0 in cauldron ( Cauldron mostly only needs to hold released native app versions (and the exact versions of the miniapps included in this native app version, be it as git hub repo with tags or npm registry with fixed version), so that it knows what is precisely inside each released native application version to guarantee code push safety. For the rest, especially dev CI, cauldron can be bypassed (at least for storing dev native app version). |
Right after sending the "bug report", I realised I had made last miniapp release a week ago. That explains the old content, exactly as you said :) Still was hoping you might have some advice, as you in deed did. Great many thanx! Tried several different ways, got several different errors. Here's some better ones: ERROR 1: When trying the https url you suggested, it fails jmiettunen@mac-11339 my-miniapp (master) $ ern create-container --miniapps https://github.saobby.my.eu.orgpa.ny/Project/my-miniapp --outDir $PWD/.container/android --platform android
✖ Command failed: /Users/jmiettunen/.ern/versions/0.14.3/node_modules/ern-core/node_modules/.bin/yarn add https://github.saobby.my.eu.orgpa.ny/Project/my-miniapp --ignore-engines --non-interactive --exact
error An unexpected error occurred: "https://github.saobby.my.eu.orgpa.ny/Project/my-miniapp: Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?". Seems like this error happens, because Error downloading git repo over HTTP without a commit hash So I'll try to define URL as git repo. These URL scheme were found from your PackagePath-test.js file. Just adding .git at the end of https url: ERROR 2: jmiettunen@mac-11339 my-miniapp (master) $ ern create-container --miniapps https://github.saobby.my.eu.orgpa.ny/Project/my-miniapp.git --outDir $PWD/.container/android --platform android
⠇ Generating Container locallyrunLocalContainerGen failed: Error: Command failed: /Users/jmiettunen/.ern/versions/0.14.3/node_modules/ern-core/node_modules/.bin/yarn add https://github.saobby.my.eu.orgpa.ny:Project/my-miniapp.git --ignore-engines --non-interactive --exact
error An unexpected error occurred: "Refusing to download the git repo {\"hostname\":\"github.compa.ny\",\"protocol\":\"https:\",\"repository\":\"https://github.saobby.my.eu.orgpa.ny/:Project/my-miniapp.git\"} over HTTPS without a commit hash - possible certificate error?". I would prefer not to define commit hash, somehow I feel this should work without it. I always want to use HEAD of master git branch (in this case), not any specific commit. Yes, I could get last commit hash of origin master with e.g. git ls-remote git@github.compa.ny:Project/my-miniapp | grep refs/heads/master | cut -f 1 Then trying some combinations of ssh urls, e.g.: ERROR 3: jmiettunen@mac-11339 my-miniapp (master) $ ern create-container --miniapps git+ssh://git@github.compa.ny:Project/my-miniapp.git --outDir $PWD/.container/android --platform android
[v0.14.3] [Cauldron: my-cauldron]
✔ Validity checks have passed
⠸ Generating Container locallyrunLocalContainerGen failed: Error: Cannot find module '/var/folders/tp/gjpvd0wn0350tz0qndp0cb2j_sy6vd/T/tmp-35615ulIJU6wzIzjM/node_modules/@apps/my-miniapp/package.json'
✖ Cannot find module '/var/folders/tp/gjpvd0wn0350tz0qndp0cb2j_sy6vd/T/tmp-35615ulIJU6wzIzjM/node_modules/@apps/my-miniapp/package.json' When I go into that tmp folder, this is what's there (below). There is no jmiettunen@mac-11339 my-miniapp $ pwd
/private/var/folders/tp/gjpvd0wn0350tz0qndp0cb2j_sy6vd/T/tmp-35615ulIJU6wzIzjM/node_modules/@apps/my-miniapp
jmiettunen@mac-11339 my-miniapp $ ls -la
total 104
drwxr-xr-x 18 jmiettunen domänen-benutzer 576 Mar 26 14:17 .
drwxr-xr-x 8 jmiettunen domänen-benutzer 256 Mar 26 14:17 ..
-rw-r--r-- 1 jmiettunen domänen-benutzer 68 Mar 26 09:53 .babelrc
-rw-r--r-- 1 jmiettunen domänen-benutzer 114 Mar 26 09:53 .buckconfig
drwxr-xr-x 3 jmiettunen domänen-benutzer 96 Mar 26 14:17 .container
-rw-r--r-- 1 jmiettunen domänen-benutzer 228 Mar 26 09:53 .eslintrc.json
-rw-r--r-- 1 jmiettunen domänen-benutzer 186 Mar 26 09:53 .flow-coverage-report.json
-rw-r--r-- 1 jmiettunen domänen-benutzer 3673 Mar 26 09:53 .flowconfig
-rw-r--r-- 1 jmiettunen domänen-benutzer 16 Mar 26 09:53 .gitattributes
-rw-r--r-- 1 jmiettunen domänen-benutzer 1265 Mar 26 09:53 .gitignore
-rw-r--r-- 1 jmiettunen domänen-benutzer 265 Mar 26 09:53 .npmignore
-rw-r--r-- 1 jmiettunen domänen-benutzer 78 Mar 26 09:53 .npmrc
-rw-r--r-- 1 jmiettunen domänen-benutzer 13 Mar 26 09:53 .prettierignore
drwxr-xr-x 3 jmiettunen domänen-benutzer 96 Mar 26 14:17 .vscode
-rw-r--r-- 1 jmiettunen domänen-benutzer 2 Mar 26 09:53 .watchmanconfig
-rw-r--r-- 1 jmiettunen domänen-benutzer 63 Mar 26 09:53 .yarnrc
-rw-r--r-- 1 jmiettunen domänen-benutzer 446 Mar 26 09:53 .zappr.yaml
drwxr-xr-x 4 jmiettunen domänen-benutzer 128 Mar 26 14:17 node_modules
SUCCESS: the only one that has worked so far is using file scheme - and running ern create-container --miniapps file:$PWD --outDir $PWD/.container/android --platform android Any suggestions or comments? I think we now got some functional solution, so otherwise you can close this. Much appreciated for your help! |
@jomnius Sorry for my belated answer, I am currently on vacation with limited time to look to issues.
|
Just a note that this issue can be closed... although having this documented in some place could be really useful! |
PROBLEM:
I created iOS ElectrodeContainer framework and copied that into native application. When native application was launched, and it then launched the Electrode Native screen, it was using one week old code instead of the latest changes.
I cannot figure out how to make sure included
MiniApp.jsbundle
contains latest code. I was told that doingern run-ios
would regenerate the bundle, but I use that command rarely. Most likely last time one week ago.(Oh, I need to do "npm install -g ios-deploy"! Never knew...)
I'm looking for CI/CD compatible way to make sure that MiniApp.jsbundle is generated from latest codes and included into iOS ElectrodeContainer framework.
DETAILS:
When opening the auto-generated
ElectrodeContainer.xcodeproj
, selecting project root (ElectrodeContainer), Project (ElectrodeContainer) - Target (ElectrodeContainer) and then looking at "Build Phases" and "Copy Bundle Resources", I can see MiniApp.jsbundle on the list. The file does exist inside framework.Please note that I'm not running
react-native-xcode.sh
by myself at any point and I cannot see it anywhere in Xcode project. Should it be somewhere? Should I run it myself?I deleted ~/.ern folder, MyApp node_modules folder and yarn.lock file. Then I run more or less following commands:
Then I created framework without errors, about:
And then copied the generated framework to native app, which was successfully built and launched.
QUESTION:
Which step is generating the production
MiniApp.jsbundle
and based on what? I thought it's done atern create-container
, but since the native app got old stuff, I must be missing some refresh step.The text was updated successfully, but these errors were encountered: