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

Nuxt unable to connect to visual editing – shallowequal does not provide an export named 'default' (at styled-components.browser.esm.js?v=ca1ca438:4:8) #1159 #2692

Open
3 tasks done
MichaelPrecel opened this issue Feb 13, 2025 · 1 comment

Comments

@MichaelPrecel
Copy link

Encountering a tonne of issues with Nuxt and Sanity visual editing. Have opened this issue in the Nuxt module repo, but thought it might be worthwhile putting here as well in case the Sanity team have any suggestions.

Version

@nuxtjs/sanity module: 1.13.3
nuxt: 3.15.4

Nuxt configuration

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  devtools: { enabled: false },

  future: {
    compatibilityVersion: 4,
  },

  modules: ["@nuxtjs/sanity"],

  sanity: {
    apiVersion: "2025-02-13",
    projectId: "3jds3t8i",
    dataset: "production",
    visualEditing: {
      studioUrl: "http://localhost:3333",
      token: "",
    },
  },

  compatibilityDate: "2025-02-13",
});

Reproduction

Minimal reproduction:
https://github.com/MichaelPrecel/Nuxt-Sanity-Visual-Editing-issue-reproduction/tree/main

What is actually happening?

Visual editing is unable to connect. Receiving error

Uncaught (in promise) SyntaxError: The requested module '/_nuxt/@fs/Users/michaelprecel/Sites/EACH/each-minimal-repro/Nuxt-Sanity-Visual-Editing-issue-reproduction/nuxt-repro/node_modules/.pnpm/[email protected]/node_modules/shallowequal/index.js?v=ef34c05a' does not provide an export named 'default' (at styled-components.browser.esm.js?v=ef34c05a:4:8)

Image

Steps to reproduce

  1. Pnpm install both nuxt-repro and sanity-repro
  2. Run pnpm dev on both nuxt and sanity folders
  3. In Sanity, enter Presentation mode
  4. Open browser console to see issue

Additional information

Checklist

  • I have tested with the latest Nuxt version and the issue still occurs
  • I have tested with the latest module version and the issue still occurs
  • I have searched the issue tracker and this issue hasn't been reported yet

Package.json

{
  "name": "nuxt-app",
  "private": true,
  "type": "module",
  "scripts": {
    "build": "nuxt build",
    "dev": "nuxt dev",
    "generate": "nuxt generate",
    "preview": "nuxt preview",
    "postinstall": "nuxt prepare"
  },
  "dependencies": {
    "@nuxtjs/sanity": "1.13.3",
    "@sanity/client": "^6.28.0",
    "nuxt": "^3.15.4",
    "react": "18",
    "vue": "latest",
    "vue-router": "latest"
  }
}

@tlebeitsuk
Copy link

See #1159

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