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

fix: Safe connector not working in some Vite apps #4371

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

iceanddust
Copy link
Contributor

@iceanddust iceanddust commented Oct 29, 2024

Description

Fixes #4364 by using the same logic applied in the MetaMask and CoinbaseWallet connectors

Copy link

changeset-bot bot commented Oct 29, 2024

🦋 Changeset detected

Latest commit: b74c449

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@wagmi/connectors Patch
wagmi Patch
@wagmi/vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Oct 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wagmi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 29, 2024 9:30pm

@iceanddust iceanddust changed the title Fix safe connector Fix safe connector not working in some Vite apps Oct 29, 2024
@iceanddust iceanddust changed the title Fix safe connector not working in some Vite apps fix: Safe connector not working in some Vite apps Oct 29, 2024
@1997roylee
Copy link
Contributor

1997roylee commented Oct 30, 2024

I recommend not making a code change for this issue. Please refer to this link for more details.

Instead, you might consider replacing your vite.config.ts with the following code:

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

// https://vitejs.dev/config/
export default defineConfig({
  root: "src",
  envDir: "./",
  build: {
    outDir: "./dist",
  },
  plugins: [react()],
  optimizeDeps: {
    include: ["@safe-global/safe-apps-provider"],
  },
});

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

Successfully merging this pull request may close these issues.

Safe connector not working, throwing a SafeAppProvider is not a constructor error
2 participants