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

Visual editing not working with Astro #279

Open
aldo-roman opened this issue Feb 9, 2025 · 1 comment
Open

Visual editing not working with Astro #279

aldo-roman opened this issue Feb 9, 2025 · 1 comment

Comments

@aldo-roman
Copy link

aldo-roman commented Feb 9, 2025

If you find a security vulnerability, do NOT open an issue. Email [email protected] instead.

Describe the bug

Error hydrating /node_modules/@sanity/astro/dist/visual-editing/visual-editing-component.tsx SyntaxError: The requested module 'http://localhost:4321/node_modules/shallowequal/index.js?v=d9fb4506'

To Reproduce

Same as #175

Expected behavior

Sanity studio loads

Screenshots
If applicable, add screenshots to help explain your problem.

Which versions of Sanity are you using?

@sanity/cli (global)    3.74.1 (up to date)
@sanity/astro           3.1.11 (up to date)
@sanity/visual-editing  2.13.0 (up to date)
sanity                  3.74.1 (up to date)

What operating system are you using?
MacOS

Which versions of Node.js / npm are you running?

Node 20.12, NPM 10.5

Additional context

I downgraded to @sanity/[email protected] and @sanity/[email protected] and it worked. NPM couldn't find version 3.1.10.

In @sanity/[email protected] and @sanity/[email protected], it is solved by using:

// astro.config.mjs
  vite: {
    plugins: [tailwindcss()],
    optimizeDeps: {
      include: ["@sanity/visual-editing/*"],
    },
  },
@MichalRsa
Copy link

It's the same error for me.

Solved by downgrading to @sanity/[email protected]. Works with @sanity/[email protected].

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

No branches or pull requests

2 participants