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

[React Router v7 / Remix] Visual editing doesn't work with Cloudflare #2310

Open
mihaipxm opened this issue Dec 11, 2024 · 0 comments
Open

Comments

@mihaipxm
Copy link

mihaipxm commented Dec 11, 2024

Describe the bug

I'm getting the following error when using Visual Editing with React Router v7, configured for Cloudflare Pages deployment.

[vite-node-miniflare error] ReferenceError: require is not defined at /node_modules/react-compiler-runtime/dist/index.js?v=d14a6f30:16:13 at Object.runViteModule (/node_modules/@hiogawa/vite-node-miniflare/dist/worker-entry.js:1320:15) at ViteRuntime.directRequest (/node_modules/@hiogawa/vite-node-miniflare/dist/worker-entry.js:1231:78) at ViteRuntime.cachedRequest (/node_modules/@hiogawa/vite-node-miniflare/dist/worker-entry.js:1154:28) at request (/node_modules/@hiogawa/vite-node-miniflare/dist/worker-entry.js:1181:128) at /node_modules/@sanity/visual-editing/dist/react-router/index.js?v=d14a6f30:2:31 at Object.runViteModule (/node_modules/@hiogawa/vite-node-miniflare/dist/worker-entry.js:1320:9) at ViteRuntime.directRequest (/node_modules/@hiogawa/vite-node-miniflare/dist/worker-entry.js:1231:60) at ViteRuntime.cachedRequest (/node_modules/@hiogawa/vite-node-miniflare/dist/worker-entry.js:1155:79) at /app/root.tsx:4:31

To Reproduce

Steps to reproduce the behavior:

  1. Clone this template https://github.com/SimeonGriggs/sanity-react-router-preview
  2. Adapt to use Cloudflare based on this template https://github.com/remix-run/react-router-templates/tree/main/cloudflare
  3. Run npm run typecheck and npm run dev

Expected behavior

Visual editing running without errors.

Which versions of Sanity are you using?

@sanity/cli (global) 3.20.1 (latest: 3.67.0) @sanity/image-url 1.1.0 (up to date) @sanity/react-loader 1.10.28 (up to date) @sanity/visual-editing 2.10.6 (up to date)

What operating system are you using?

Mac OS

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

10.9.0 v22.11.0

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

1 participant