Error: Dynamic Code Evaluation (e. g. 'eval', 'new Function', 'WebAssembly.compile') not allowed in Edge Runtime #10959
Unanswered
alananisimov
asked this question in
Help
Replies: 1 comment 4 replies
-
Do you want to use the |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I created custom credentials provider, that works on stellar-sdk. This library is using WebAssembly.compile func, which is not supported by edge runtime. Maybe somehow I can switch to Nodejs runtime.
Code:
`import slugify from "@sindresorhus/slugify";
import { Keypair, StrKey } from "@stellar/stellar-sdk";
import Credentials from "next-auth/providers/credentials";
import { Register } from "@acme/backend";
import { secretKeyProviderSchema } from "@acme/validators";
export const secretKeyProvider = Credentials({
name: "secret_key",
credentials: {
secret_key: { label: "Secret Key", type: "text" },
wallet_name: { label: "Wallet name", type: "text" },
ref_id: { label: "Referral ID", type: "number" },
},
async authorize(credentials) {
if (!credentials) return null;
const {
secret_key: sk,
wallet_name,
ref_id,
} = await secretKeyProviderSchema.parseAsync(credentials);
const valid_sk = StrKey.isValidEd25519SecretSeed(sk);
},
});
Error: Dynamic Code Evaluation (e. g. 'eval', 'new Function', 'WebAssembly.compile') not allowed in Edge Runtime Learn More: https://nextjs.org/docs/messages/edge-dynamic-code-evaluation The error was caused by importing '@stellar/stellar-sdk/dist/stellar-sdk.min.js' in '../../packages/auth/src/providers/secret-key.ts'.
Beta Was this translation helpful? Give feedback.
All reactions