cannot get react-static export working on aws lambda #1591
Unanswered
Davidvision
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Well, I found a working solution now :) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everybody,
I've been trying to export my react-static bundled website on aws lambda but it seems i can't get it to work, so I really hope someone will be able to help me on this :) !
Here are the steps i tried :
await rs()
, I get the following error on the console :Well, after this wondered if I could get it working while running the actual react-static command as such :
Running build, it worked, both locally and in the lambda function where I was able to upload the resulting tmp/dist directory on my s3 bucket, awesome.
But my aim is to only do
react-static export
on lambda, as I won't bundle the app much often.Well, I first ran
react-static bundle
locally, then I tried the following :It worked perfectly on my local machine, but it doesn't on lambda.
the error i'm getting in lambda's log is the following :
It seems that react-static isn't able to find
'/tmp/artifacts/static-app.js'
.I'm aware that the local task directory in lambda is a read-only one, and that the only writable one is the /tmp directory. So i tried to copy the whole artifacts, dist, and tmp directories to /tmp, making sure that config.paths in static.config.js all point to the /tmp folder, but I still get the error...
I honestly ran out of ideas on how to solve this, that's why I came here !
So...
First, any ideas on why running
await rs()
(as in here) doesn't work as it seems to be the recommended way ?And any ideas on why react-static isn's able to find find
'/tmp/artifacts/static-app.js'
?Thanks a lot for your help :)
Beta Was this translation helpful? Give feedback.
All reactions