This message was deleted.
# help
s
This message was deleted.
t
what are you seeing?
it's empty? or it fails to load
t
Heya thxdr.
When I ...
Copy code
console.log(process.env.API)
... from the website JS, I get a ReferenceError: Can't find variable: process.
t
That error isn't coming from sst
what kind of static site is it?
t
A little more research shows that the string/token process.env.API isn't being interpolated / replaced.
I'm using parceljs (same a old version) and right now it's a pretty empty site. one html file with one js file where I'm just trying to get the process.env.API replaced.
You're correct - the error is in the web browser, running the "sst-env -- parcel --open" launched site.
SST isn't displaying any errors.
t
Yeah I'm saying the "process is not defined" doesn't have anything to do with sst
t
It does if SST-ENV isn't replacing "process.env.API" with the correct API Endpoint URL.
In the working version (old version), the following...
Copy code
return fetch(`${process.env.API}/${path}`, {
...becomes...
Copy code
return fetch(`${'<http://xxxxxx.execute-api.us-east-1.amazonaws.com|xxxxxx.execute-api.us-east-1.amazonaws.com>'}/${path}`, {
Point is ... sst-env isn't interpolating / replacing the process.env.API token/string in the JS like it should be (or was in the old version).
Also, for what it's worth, the sst-env on the working version is 0.50.0.
The problem was that I didn't have type="module" on the <script> tag.