0

I am trying to run safe-core-sdk/pacakages/auth-kit/example independently i.e via installing @safe-global/auth-kit separatelly.

It is working fine on local developement environment. But giving build error on running yarn build

transforming (1) index.htmlUnexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit:
(vite:build-import-analysis) transform "/home/user/Frontend/example/src/main.tsx"
(commonjs--resolver) resolveId "react-dom/client" "/home/user/Frontend/example/src/main.tsx"
(vite:optimized-deps-build) load "/home/user/Frontend/example/node_modules/.vite/deps_build-dist/react-dom_client.js"
error during build:
Error: Unexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit:
(vite:build-import-analysis) transform "/home/user/Frontend/example/src/main.tsx"
(commonjs--resolver) resolveId "react-dom/client" "/home/user/Frontend/example/src/main.tsx"
(vite:optimized-deps-build) load "/home/amit/Frontend/example/node_modules/.vite/deps_build-dist/react-dom_client.js"
    at EventEmitter.handleEmptyEventLoop (file:///home/user/Frontend/example/node_modules/rollup/dist/es/shared/rollup.js:24256:20)
    at Object.onceWrapper (node:events:626:28)
    at EventEmitter.emit (node:events:512:28)
    at process.<anonymous> (file:///home/user/Frontend/example/node_modules/rollup/dist/es/shared/rollup.js:24250:55)
    at process.emit (node:events:512:28)

1 Answer 1

0

You can try to use the below vite.config.ts configuration instead the one originally created to run in the safe-core-sdk monorepo (You need to add vite-plugin-node-polyfills as a dev dependency):

import { defineConfig } from 'vite'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [react(), nodePolyfills()],
  server: {
    port: 3000
  }
})

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.