Moralis VUE TypeError super expression must be either null or a function

Im trying to use Moralis with my vite/vue project but I always get the error on compilation.

inherits.js:9 Uncaught TypeError: Super expression must either be null or a function
    at _inherits (inherits.js:9:11)
    at AbstractWeb3Connector.js:84:18
    at node_modules/moralis/lib/browser/Web3Connector/AbstractWeb3Connector.js (AbstractWeb3Connector.js:218:1)
    at __require2 (chunk-M7N4COWV.js?v=bf5c346b:47:50)
    at node_modules/moralis/lib/browser/Web3Connector/WalletConnectWeb3Connector.js (WalletConnectWeb3Connector.js:39:53)
    at __require2 (chunk-M7N4COWV.js?v=bf5c346b:47:50)
    at node_modules/moralis/lib/browser/MoralisWeb3.js (MoralisWeb3.js:87:58)
    at __require2 (chunk-M7N4COWV.js?v=bf5c346b:47:50)
    at node_modules/moralis/lib/browser/ParseUser.js (ParseUser.js:51:42)
    at __require2 (chunk-M7N4COWV.js?v=bf5c346b:47:50)
<script setup lang="ts">
import Moralis from "moralis";

Moralis.start({appId: process.env.VITE_MORALIS_APP_ID, serverUrl: process.env.VITE_MORALIS_SERVER_URL})
</script>

Try changing it to
Moralis.start({process.env.VITE_MORALIS_APP_ID, process.env.VITE_MORALIS_SERVER_URL})

Hi, iā€™m having the same error with vite+react too.

ReactDOM.render(
  <React.StrictMode>
    <MoralisProvider
      serverUrl={import.meta.env.VITE_MOLARIS_SERVER_URL}
      appId={import.meta.env.VITE_MORALIS_APP_ID}
    >
      <Provider store={store}>
        <App />
      </Provider>
    </MoralisProvider>
  </React.StrictMode>,
  document.getElementById('root')
)

Error:

Hello hope you have solved this. If not, I have tested that this solution works on the latest Moralis and react-moralis releases.