Roger Chi
09/23/2021, 8:16 PMOnly absolute URLs...
error in cloudwatch logs for the main site edge function) unless I also define a .env.local file within the frontend directorythdxr
09/23/2021, 8:20 PMgetServerSideProps
runs but if it's during build time it can't be set through the environment
fieldthdxr
09/23/2021, 8:20 PMthdxr
09/23/2021, 8:21 PMenvironment
property values only get replaced after a full deploy so we can get the values of potentially newly created resourcesRoger Chi
09/23/2021, 8:24 PMthdxr
09/23/2021, 8:26 PMRoger Chi
09/23/2021, 8:28 PMthdxr
09/23/2021, 8:29 PMthdxr
09/23/2021, 8:29 PMRoger Chi
09/23/2021, 8:29 PMthdxr
09/23/2021, 8:31 PMthdxr
09/23/2021, 8:32 PMtenant={{ TENANT }}
. Then the build should get generated with the literal {{ TENANT }}
and once everything is done deploying we replace those with real values in s3thdxr
09/23/2021, 8:33 PMRoger Chi
09/23/2021, 8:39 PMFrank
Roger Chi
09/23/2021, 8:43 PM"dependencies": {
"@serverless-stack/cli": "0.43.3",
"@serverless-stack/resources": "0.43.3",
"@aws-cdk/core": "1.114.0"
}
Frank
Frank
MainFunction
in its name;
3. open up the Code
tab
4. in the file explorer on the left, select pages
and open up the file for the page that has process.env
in getServerSideProps()
5. search for ie. {{ BASE_URL }}
Frank
Roger Chi
09/23/2021, 8:55 PMRoger Chi
09/23/2021, 8:55 PMRoger Chi
09/23/2021, 9:02 PMRoger Chi
09/23/2021, 9:02 PMFrank
process.env
should get resolved by Next.js on build 🤔Frank
BASE_URL={{ BASE_URL }} next build
And the code above should look like:
console.log("{{ BASE_URL }}");
Frank
Frank
process.env.BASE_URL
there in ur code.Frank
console.log(process.env.BASE_URL)
, you are seeing that in ur Lambda console? A page within the pages
directory in the file explorer?Roger Chi
09/23/2021, 9:13 PMFrank
.build
folder, can you show me what’s in there?Frank
default-lambda
?Frank
console.log(process.env.BASE_URL)
in there?Roger Chi
09/23/2021, 9:36 PMFrank
npm run build
inside your Next.js app?Roger Chi
09/23/2021, 9:53 PMFrank
Frank
Frank
Roger Chi
09/23/2021, 9:59 PMFrank
Frank
npm install --save --save-exact @serverless-stack/cli@0.43.4 @serverless-stack/resources@0.43.4
Frank
Frank
next.config.js
any more!Warwick Grigg
09/24/2021, 2:50 PMRoger Chi
09/24/2021, 3:25 PMFrank