nitro icon indicating copy to clipboard operation
nitro copied to clipboard

Preset cloudflare-pages/cloudflare-module not working with @aws-sdk

Open rhaenni opened this issue 1 year ago • 6 comments

Environment

Nuxt 3.8.0 with Nitro 2.7.2 vite v4.5.0

Reproduction

https://codesandbox.io/p/github/unjs/nitro/csb-z43zd7/draft/tender-wu

  1. Run "Nitro Build" Task from the "Run Task or Terminal" button
  2. Run "Wrangler" Task 3.-> observe following error when the code is trying to load the @aws-sdk
[nitro] [request error] [unhandled] Cannot convert object to primitive value
  at e2.defaultUserAgent (file:.//project/nitro/.wrangler/tmp/dev-mFkcA3/dmwkb6o22td.js:13983:77)  
  at Um.getRuntimeConfig (file:.//project/nitro/.wrangler/tmp/dev-mFkcA3/dmwkb6o22td.js:15730:388)  
  at new PollyClient (file:.//project/nitro/.wrangler/tmp/dev-mFkcA3/dmwkb6o22td.js:15755:44)  
  at file:.//project/nitro/.wrangler/tmp/dev-mFkcA3/dmwkb6o22td.js:16681:14  
  at file:.//project/nitro/.wrangler/tmp/dev-mFkcA3/dmwkb6o22td.js:2318:26  
  at Object.handler (file:.//project/nitro/.wrangler/tmp/dev-mFkcA3/dmwkb6o22td.js:3428:54)  
  at Object.handler (file:.//project/nitro/.wrangler/tmp/dev-mFkcA3/dmwkb6o22td.js:2343:29)  
  at async file:.//project/nitro/.wrangler/tmp/dev-mFkcA3/dmwkb6o22td.js:2420:7  
  at async file:.//project/nitro/.wrangler/tmp/dev-mFkcA3/dmwkb6o22td.js:3451:20  
  at async jsonError (file:.//project/nitro/.wrangler/tmp/dev-mFkcA3/dmwkb6o22td.js:16695:12)

Describe the bug

Can not use AWS-SDK with cloudflare-pages/cloudflare-module Nitro Preset and using wrangler to deploy to Cloudflare, always getting errors from AWS-SDK.

I found a somewhat related issue but don't understand how to workaround: https://github.com/cloudflare/workers-sdk/issues/2081

Additional context

No response

Logs

No response

rhaenni avatar Nov 04 '23 09:11 rhaenni