cloudflare / workers-sdk

ā›…ļø Home to Wrangler, the CLI for Cloudflare WorkersĀ®
https://developers.cloudflare.com/workers/
Apache License 2.0
2.64k stars 694 forks source link

šŸ› BUG: Plugin "unenv-cloudflare" returned a non-absolute path: buffer (set a namespace if this is not a file path) #6895

Open oyeesam opened 2 weeks ago

oyeesam commented 2 weeks ago

Which Cloudflare product(s) does this pertain to?

Pages

What version(s) of the tool(s) are you using?

wrangler@3.80.0

What version of Node are you using?

No response

What operating system and version are you using?

v20.11.0

Describe the Bug

Observed behavior

I am using iron-session package, which with wrangler prevew command is giving me following error


āœ˜ [ERROR] Plugin "unenv-cloudflare" returned a non-absolute path: buffer (set a namespace if this is not
 a file path)

    ../node_modules/.pnpm/iron-webcrypto@0.2.8/node_modules/iron-webcrypto/dist/index.js:3:23:
      3 ā”‚ var index_js = require('buffer/index.js');
        ā•µ                        ~~~~~~~~~~~~~~~~~

āœ˜ [ERROR] Failed to build Functions at ./functions.

I am using Remix

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

āœ˜ [ERROR] Plugin "unenv-cloudflare" returned a non-absolute path: buffer (set a namespace if this is not a file path)

../node_modules/.pnpm/iron-webcrypto@0.2.8/node_modules/iron-webcrypto/dist/index.js:3:23:
  3 ā”‚ var index_js = require('buffer/index.js');
    ā•µ                        ~~~~~~~~~~~~~~~~~

āœ˜ [ERROR] Failed to build Functions at ./functions.

emily-shen commented 1 week ago

Hiya, this looks like an issue with the iron-webcrypto package. It looks like you're using quite an old version there, are you able to update iron-session which uses a more recent version of iron-webcrypto? Think iron-webcrypto needs to be a later than 0.4.0.