Hello, I have a newly created Bare Workflow application which when building in release mode for IOS throws the following error on bundling assets:
~/PROJECT/apps/native ~/PROJECT/apps/native/ios
3.18.6
[10:40:12] Request failed with status code 403
[10:40:12] Error: Request failed with status code 403
at createError (/Users/mitch/.nvm/versions/node/v12.6.0/lib/node_modules/expo-cli/node_modules/axios/lib/core/createError.js:16:15)
at settle (/Users/mitch/.nvm/versions/node/v12.6.0/lib/node_modules/expo-cli/node_modules/axios/lib/core/settle.js:17:12)
at RedirectableRequest.handleResponse (/Users/mitch/.nvm/versions/node/v12.6.0/lib/node_modules/expo-cli/node_modules/axios/lib/adapters/http.js:211:9)
at RedirectableRequest.emit (events.js:315:20)
at RedirectableRequest._processResponse (/Users/mitch/.nvm/versions/node/v12.6.0/lib/node_modules/expo-cli/node_modules/axios/node_modules/follow-redirects/index.js:269:10)
at ClientRequest.RedirectableRequest._onNativeResponse (/Users/mitch/.nvm/versions/node/v12.6.0/lib/node_modules/expo-cli/node_modules/axios/node_modules/follow-redirects/index.js:50:10)
at Object.onceWrapper (events.js:422:26)
at ClientRequest.emit (events.js:315:20)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:610:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:116:17)
Command PhaseScriptExecution failed with a nonzero exit code
Observations / Things We’ve Checked
We are using import { registerRootComponent } from 'expo';
We’ve published the application with expo export and hosting the content on S3.
The asset links are accessible there with no 403.
Debug mode works fine.
Removing the following fixes the build by not bundling assets however the assets are still present in the assets folder:
"assetBundlePatterns": [
"**/*"
],
Weirdly on a colleagues machine this does not happen however when he opens the app it’s clear the assets have no been bundled.
I am very new to Expo as well so I might be wrong. But I was having the same problem and looks like if I sign in to expo and then do a build it works. However that’s not I wanted. Also noticed as you mentioned if we remove all the static assets it seems be working.
I found @notbrent ejected-example-fonts (GitHub - brentvatne/ejected-example-fonts) to be a good place to start. I can get this running in release mode with an image by using the icon.png he has included, however as soon as I add my own .png image to the assets folder and switch the require to that instead I get this error again.
Well I think release build hook check if the asset already in the cloud front and if the asset not exists in the cloud front then try to publish. So if you have not sign in to Expo there is no authenticated session and AWS rejects the publish request.
But I assume that if we use our own static hosting solution ( defined in public url ) expo hook should not be doing this process at all. Is there a config to turn off publish?
I followed the flow little bit deep. So in Android there is a hook to release build which fires up following command and that one seems try to publish the assets to AWS cloud front.
So just to test the theory, I rerouted all the Expo cloud-front traffic to a simple HTTP server hosting the dist assets using Charles proxy. So the build get successful!
Wonder this can be added as a feature for detached/bare workflow users they can specify the asset location so expo can start reading the assets from there.
hey folks, give expo-cli@3.19.2 a spin, this should resolve your issue. really appreciate you all digging in and giving us useful information to help debug.
@samithaf - i also confirmed that you do not need sign in / have an expo account to use this expo export flow with expo-updates by doing my testing around the above fix in both signed in and signed out states
I’m having exactly the same issue using expo-cli 3.27.14
Currently set Charles up to redirect cloudfront back to localhost:9000/
I’m not entirely sure what’s causing it, it worked absolutely fine yesterday/last night, but gives me 403 on a new asset png I added to the project today - Still unclear why it’s even trying to reach out to Cloudfront when I’ve exported the assets to a local dist folder, and running a local asset server.