# \[Archive\] Error when calling web3auth.value.init()

**URL:** <https://builder.metamask.io/t/archive-error-when-calling-web3auth-value-init/2022>\
**Category:** Embedded Wallets (Web3Auth)\
**Created:** [March 23, 2023, 5:15pm UTC](https://builder.metamask.io/t/archive-error-when-calling-web3auth-value-init/2022 "2023-03-23T17:15:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![denisa.halmaghi](https://avatars.discourse-cdn.com/v4/letter/d/d07c76/32.png) [@denisa.halmaghi](https://builder.metamask.io/u/denisa.halmaghi)\
**Post date:** [March 23, 2023, 5:15pm UTC](https://builder.metamask.io/t/archive-error-when-calling-web3auth-value-init/2022/1 "2023-03-23T17:15:37Z")

</div>

> **🏛 Archived Content from Web3Auth Community**
> 
> This topic was originally posted by **denisa.halmaghi** on 3/23/2023.  
> This content has been migrated from our previous community forum to preserve valuable discussions.

* * *

Hello!  
I have an issue with initializing web3auth. The specific error I get is the following:  
`postMessageStream.ts:22 Uncaught DOMException: Failed to execute 'postMessage' on 'Window': #<Object> could not be cloned.`

- SDK Version:  
“@web3auth/base”: “^5.0.1”,  
“@web3auth/no-modal”: “^5.0.1”,  
“@web3auth/openlogin-adapter”: “^5.0.1”,
- Platform:  
macOS 13.2.1  
Node 18.12.1  
Vue ^3.2.38  
Vite ^4.1.1
- Browser Console Screenshots:  

[
Screenshot 2023-03-23 at 19.10.35871×270 63.6 KB
](https://builder.metamask.io/community/community/uploads/default/original/1X/179248808e372c52d1e7731e57c5863a03c6fd4d.png "Screenshot 2023-03-23 at 19.10.35")

Full component code (adapted from react-vite-evm-no-modal-example)

```auto
<template>
  <div id="app">
    <button class="card" style="cursor: pointer" @click="login">Login</button>
  </div>
</template>
<script lang=“ts” setup>
import { onMounted, ref, type Ref } from ‘vue’;
import { Web3AuthNoModal } from ‘@web3auth/no-modal’;
import { CHAIN_NAMESPACES, WALLET_ADAPTERS } from ‘@web3auth/base’;
import { OpenloginAdapter } from ‘@web3auth/openlogin-adapter’;
const clientId = import.meta.env.VITE_CLIENT_ID;
const web3auth = ref(null) as Ref<Web3AuthNoModal | null>;
onMounted(async () => {
const auth = new Web3AuthNoModal({
clientId,
chainConfig: {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: ‘0x1’,
rpcTarget: ‘https://rpc.ankr.com/eth’, // This is the public RPC we have added, please pass on your own endpoint while creating an app
},
web3AuthNetwork: ‘cyan’,
});
const openloginAdapter = new OpenloginAdapter({
loginSettings: {
mfaLevel: ‘default’,
},
adapterSettings: {
whiteLabel: {
name: ‘Your app Name’,
logoLight: ‘https://web3auth.io/community/images/w3a-L-Favicon-1.svg’,
logoDark: ‘https://web3auth.io/community/images/w3a-D-Favicon-1.svg’,
defaultLanguage: ‘en’,
dark: true, // whether to enable dark mode. defaultValue: false
},
},
});
auth.configureAdapter(openloginAdapter);
web3auth.value = auth;
try {
await web3auth.value.init();
} catch (error) {
console.log(‘🚀 ~ file: TestLoginPage4.vue:55 ~ onMounted ~ error:’, error);
}
});

```

My vite.config.ts:

```auto
import { fileURLToPath, URL } from 'node:url';
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { quasar, transformAssetUrls } from '@quasar/vite-plugin';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
// Configuring Vite | Vite
export default defineConfig({
plugins: [
vue({
template: { transformAssetUrls },
}),
quasar({
  sassVariables: 'src/css/quasar.variables.sass',
}),
nodePolyfills({
  // Whether to polyfill `node:` protocol imports.
  protocolImports: true,
}),

```

---

<div class="post-metadata">

**Author:** ![himanshu](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@himanshu](https://builder.metamask.io/u/himanshu)\
**Post date:** [March 23, 2023, 8:16pm UTC](https://builder.metamask.io/t/archive-error-when-calling-web3auth-value-init/2022/2 "2023-03-23T20:16:00Z")

</div>

I think this error is happening because web3auth instances cant be stored in vue ref.  
To solve this issue, consider removing `const web3auth = ref(null) as Ref<Web3AuthNoModal | null>;` and may be use a static wrapper class around web3auth instance.

---

<div class="post-metadata">

**Author:** ![denisa.halmaghi](https://avatars.discourse-cdn.com/v4/letter/d/d07c76/32.png) [@denisa.halmaghi](https://builder.metamask.io/u/denisa.halmaghi)\
**Post date:** [March 24, 2023, 8:41am UTC](https://builder.metamask.io/t/archive-error-when-calling-web3auth-value-init/2022/3 "2023-03-24T08:41:45Z")

</div>

I’ll try this sollution. Thanks!

---

<div class="post-metadata">

**Author:** ![denisa.halmaghi](https://avatars.discourse-cdn.com/v4/letter/d/d07c76/32.png) [@denisa.halmaghi](https://builder.metamask.io/u/denisa.halmaghi)\
**Post date:** [March 24, 2023, 9:24am UTC](https://builder.metamask.io/t/archive-error-when-calling-web3auth-value-init/2022/4 "2023-03-24T09:24:17Z")

</div>

It worked! Thank you! But could this perhaps be specified somewhere in the docs? Maybe in the troubleshooting section.
