Cannot SST deploy Cloudflare Worker due to 'Cannot use import statement outside a module'

Hi, I'm trying to move the whole infrastructure deploy from OpenTofu to SST. I use Cloudflare for everything and the only issue remains with workers. This is a configuration for the worker:
new sst.cloudflare.Worker('userWorker', {
handler: './services/user/src/index.ts',
link: [userKv],
transform: {
worker: {
scriptName: `user-service-${$app.stage}`,
},
},
})
new sst.cloudflare.Worker('userWorker', {
handler: './services/user/src/index.ts',
link: [userKv],
transform: {
worker: {
scriptName: `user-service-${$app.stage}`,
},
},
})
When deployed through GitHub Actions, it fails on Cannot use import statement outside a module. The worker is possible to deploy through Wrangler thus it seems to be an issue with SST or the configuration. What could be done to resolve this issue?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?