Any changes to workerB.ts will not trigger a reload, whereas a change to workerA.ts will. Found this out after observing none of my workers were being updated when I changed the code and then ran sst dev --verbose and observed the following log:
time=2024-04-27T14:43:21.609+01:00 level=INFO msg="building function" runtime=worker functionID=WorkerB
time=2024-04-27T14:43:21.609+01:00 level=INFO msg="loader info" loader=map[]
time=2024-04-27T14:43:21.673+01:00 level=ERROR msg="esbuild error" error="{ID: PluginName: Text:Could not resolve \"cloudflare:workers\" Location:0x14000cd6300 Notes:[{Text:You can mark the path \"cloudflare:workers\" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle. Location:<nil>}] Detail:<nil>}"
time=2024-04-27T14:43:21.673+01:00 level=INFO msg="function built" runtime=worker functionID=WorkerB
Which is an esbuild error - clearly SST is using a different esbuild config (than the one in my sst.config.ts) to check whether the worker needs a redeploy. Interestingly, the file change events are still picked up after any changes but sst does nothing with the last log being:
time=2024-04-27T14:43:53.370+01:00 level=INFO msg="checking if function should be rebuilt" runtime=worker functionID=WorkerB file=/Users/ernest/Downloads/sst-dev-issue/packages/functions/src/workerB.handler.ts
time=2024-04-27T14:43:53.370+01:00 level=INFO msg="checking if function should be rebuilt" runtime=worker functionID=WorkerA file=/Users/ernest/Downloads/sst-dev-issue/packages/functions/src/workerB.handler.ts
After that, nothing happens. It will still redeploy WorkerA after I start modifying workerA.ts, but any changes to workerB.ts are picked up, but stop at the log above without redeploying.
sst dev
(version0.0.322
) does not reload a function that imports fromcloudflare:workers
(related to#256
).Steps to reproduce:
sst install
)sst dev
packages/functions/src/workerB.ts
packages/functions/src/workerA.ts
* Using a patch until
#239
is in a release.Any changes to
workerB.ts
will not trigger a reload, whereas a change toworkerA.ts
will. Found this out after observing none of my workers were being updated when I changed the code and then ransst dev --verbose
and observed the following log:Which is an esbuild error - clearly SST is using a different esbuild config (than the one in my
sst.config.ts
) to check whether the worker needs a redeploy. Interestingly, the file change events are still picked up after any changes but sst does nothing with the last log being:After that, nothing happens. It will still redeploy
WorkerA
after I start modifyingworkerA.ts
, but any changes toworkerB.ts
are picked up, but stop at the log above without redeploying.