You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hey there! i'm trying to integrate switchboard on-demand's randomness feature into my program. however, i'm encountering a strange error while running tests using the SDK, and i'm unsure how to resolve it.
the error message is as follows:
SyntaxError: Named export 'BN' not found. The requested module '@coral-xyz/anchor-30' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from '@coral-xyz/anchor-30';
const { BN, BorshAccountsCoder, utils } = pkg;
❯ tests/blet.test.ts:2:31
1| import * as anchor from "@coral-xyz/anchor";
2| import { AnchorUtils, Randomness, Queue } from "@switchboard-xyz/on-demand";
| ^
3| import { AnchorError, Program } from "@coral-xyz/anchor";
4| import {
version of @switchboard-xyz/on-demand - v1.1.39 (latest)
node.js version - v22.3.0
package manager - pnpm v9.4.0
additional context
i think it's an issue related to how the package is bundled for CJS and ESM versions. any suggestions on how to resolve this would be greatly appreciated. thanks in advance!
The text was updated successfully, but these errors were encountered:
hey there! i'm trying to integrate switchboard on-demand's randomness feature into my program. however, i'm encountering a strange error while running tests using the SDK, and i'm unsure how to resolve it.
the error message is as follows:
environment
additional context
i think it's an issue related to how the package is bundled for CJS and ESM versions. any suggestions on how to resolve this would be greatly appreciated. thanks in advance!
The text was updated successfully, but these errors were encountered: