Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: class-transformer doesn't work with vercel edge runtime #1574

Open
apexguy opened this issue Jul 23, 2023 · 1 comment
Open

fix: class-transformer doesn't work with vercel edge runtime #1574

apexguy opened this issue Jul 23, 2023 · 1 comment
Labels
status: needs triage Issues which needs to be reproduced to be verified report. type: fix Issues describing a broken feature.

Comments

@apexguy
Copy link

apexguy commented Jul 23, 2023

Description

Can't use class-transformer for input validation in nextjs edge runtime - Its fails on compilation

Expected behavior

Normal usage of the library

Actual behavior

when running npm run build

./node_modules/class-transformer/esm5/TransformOperationExecutor.js
A Node.js API is used (Buffer at line: 117) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime

@apexguy apexguy added status: needs triage Issues which needs to be reproduced to be verified report. type: fix Issues describing a broken feature. labels Jul 23, 2023
@diffy0712
Copy link

hello @apexguy,

unfortunately, this is a a bit harder to reproduce and because it does not seem to be a problem for others, it seems to be a low prio problem.
I think this is the only line that uses the Buffer.
You might be able to somehow mock that Buffer, or bypass the error for this, only if you do not intend to use Buffer (which I assume you wont).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage Issues which needs to be reproduced to be verified report. type: fix Issues describing a broken feature.
Development

No branches or pull requests

2 participants