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

ReferenceError: global is not defined #521

Open
qertis opened this issue Jun 2, 2023 · 1 comment
Open

ReferenceError: global is not defined #521

qertis opened this issue Jun 2, 2023 · 1 comment

Comments

@qertis
Copy link

qertis commented Jun 2, 2023

I try to connect metaplex for my application and get Reference error.

My code

import {  Metaplex } from '@metaplex-foundation/js'
import { Connection, clusterApiUrl, Keypair } from '@solana/web3.js'

const NETWORK = clusterApiUrl('devnet')
export const connection = new Connection(NETWORK)

console.log(Metaplex)

Libs in dependencies

"typescript": "~5.0.4",
"vite": 3.2.6,
"quasar": 2.12.0,
"@metaplex-foundation/js": "0.19.4",

Output:
image

image

image

Vite warn message:
https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility

@grumpyoldman-io
Copy link

This #534 (comment) solved it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants