You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe this is related to 1044 but this also happens with sst deploy. Not sure when this issue was introduced, but I noticed a while back the react dev build was included in my cloudflare worker, despite me having:
In the output artefact, I can see that process.env.NODE_ENV isn't replaced at all. In a separate app, I tried to create a cloudflare static site, but that never worked, failing with the following error:
"exceptions": [
{
"stack": " at respond (worker.mjs:50:7)\n at fetch (worker.mjs:15:38)",
"name": "ReferenceError",
"message": "SST_ASSET_MANIFEST is not defined",
"timestamp": 1729071695262
}
]
Inspecting the source code, I can see that SST_ASSET_MANIFEST is also supposed to be replaced with the actual manifest JSON using define, so I can only assume these two things broke at the same time.
Here's a reproduction repo; after running sst deploy, you'll still see unreplaced process.env.NODE_ENV in the output artifact of the worker and unreplaced SST_ASSET_MANIFEST in the web router output file. Trying to access the url of the static site takes you to an error page and inspecting the logs will show the same error as above.
The text was updated successfully, but these errors were encountered:
I don't know any go but just took a look at the source where I think workers get built (here) and there doesn't seem to be any mention of the define option
Ernxst
changed the title
esbuild "define" does not work
cloudflare.StaticSite does not work
Oct 18, 2024
I believe this is related to 1044 but this also happens with
sst deploy
. Not sure when this issue was introduced, but I noticed a while back the react dev build was included in my cloudflare worker, despite me having:In the
build.esbuild
of my worker.In the output artefact, I can see that
process.env.NODE_ENV
isn't replaced at all. In a separate app, I tried to create a cloudflare static site, but that never worked, failing with the following error:Inspecting the source code, I can see that
SST_ASSET_MANIFEST
is also supposed to be replaced with the actual manifest JSON usingdefine
, so I can only assume these two things broke at the same time.Here's a reproduction repo; after running
sst deploy
, you'll still see unreplacedprocess.env.NODE_ENV
in the output artifact of the worker and unreplacedSST_ASSET_MANIFEST
in the web router output file. Trying to access the url of the static site takes you to an error page and inspecting the logs will show the same error as above.The text was updated successfully, but these errors were encountered: