-
Notifications
You must be signed in to change notification settings - Fork 51
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
Unable to use Umi with Nuxt3 #124
Comments
experiencing almost the same problem, using umi always makes my nuxt stop working error
|
@viandwi24 I gave up on Solana and Metaplex... trash dx, really hated it. Never comming back. |
@ASoldo I also think like that, previously I felt umi brought good changes, but it turns out there are still problems like this, I think it's still best to use metaplex-js. my proboem when tryng to import |
this how im try to solve this issue :
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
devtools: { enabled: true },
modules: ["@nuxt/ui", "@hebilicious/vue-query-nuxt", "@pinia/nuxt"],
ssr: false,
vite: {
esbuild: {
target: "esnext",
},
build: {
target: "esnext",
},
optimizeDeps: {
include: [
"@solana/web3.js",
"@coral-xyz/anchor",
"@metaplex-foundation/umi",
"@metaplex-foundation/umi-bundle-defaults",
"@metaplex-foundation/mpl-token-metadata",
"@metaplex-foundation/digital-asset-standard-api",
"@metaplex-foundation/mpl-bubblegum",
"@metaplex-foundation/umi-rpc-web3js",
"@metaplex-foundation/umi-program-repository",
"buffer"
],
esbuildOptions: {
target: "esnext",
},
},
define: {
"process.env.BROWSER": true,
"globalThis": "window",
"global": "window",
},
},
} and then to use umi in my nuxt im using this minimal setup : import { createUmi, type RpcInterface, type Umi } from '@metaplex-foundation/umi'
import { mplTokenMetadata } from '@metaplex-foundation/mpl-token-metadata'
import { mplBubblegum } from '@metaplex-foundation/mpl-bubblegum'
import { dasApi, type DasApiInterface } from "@metaplex-foundation/digital-asset-standard-api"
import { web3JsRpc } from '@metaplex-foundation/umi-rpc-web3js'
import { defaultProgramRepository } from '@metaplex-foundation/umi-program-repository'
const umi = createUmi()
.use(defaultProgramRepository())
.use(web3JsRpc(this.options.rpc))
.use(mplTokenMetadata())
.use(mplBubblegum())
.use(dasApi()) so im not using umi bundle hope can help u |
Umi bundle isn't the issue, the issue is on umi itself and that it tries to expose node-fetch even on browser. Idk if this happens on nextjs because of module transpilation but still sucks big time. |
@kevinrodriguez-io ah i see, but for now im dont use umi bundle, import one per one like you see in my comment above |
Hi, following Metaplex tutorials I was not able to use Metaplex npm packages with Nuxt3. Is there a way to setup Nuxt3 project without Polyfill issues?
these are my errors im facing when importing {createUmi}
The text was updated successfully, but these errors were encountered: