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

Compatibility issue with Sanity 3.52.0+ #67

Closed
clinejj opened this issue Jul 26, 2024 · 4 comments
Closed

Compatibility issue with Sanity 3.52.0+ #67

clinejj opened this issue Jul 26, 2024 · 4 comments

Comments

@clinejj
Copy link

clinejj commented Jul 26, 2024

After updating our Sanity dependency to 3.52.0, we were no longer able to start the studio in dev mode (sanity dev --host=0.0.0.0). It would show the following error:

Uncaught error: _interopRequireDefault2 is not a function
http://localhost:3333/node_modules/.sanity/vite/deps/sanity-plugin-icon-picker.js?v=d414d840:4862:25
TypeError: _interopRequireDefault2 is not a function
    at node_modules/sanity-plugin-icon-picker/node_modules/xregexp/lib/xregexp.js (http://localhost:3333/node_modules/.sanity/vite/deps/sanity-plugin-icon-picker.js?v=d414d840:4862:25)
    at __require2 (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-AUZ3RYOM.js?v=3e8b93e8:18:50)
    at node_modules/sanity-plugin-icon-picker/node_modules/xregexp/lib/index.js (http://localhost:3333/node_modules/.sanity/vite/deps/sanity-plugin-icon-picker.js?v=d414d840:8665:44)
    at __require2 (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-AUZ3RYOM.js?v=3e8b93e8:18:50)
    at node_modules/sanity-plugin-icon-picker/node_modules/decamelize/index.js (http://localhost:3333/node_modules/.sanity/vite/deps/sanity-plugin-icon-picker.js?v=d414d840:8690:19)
    at __require2 (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-AUZ3RYOM.js?v=3e8b93e8:18:50)
    at http://localhost:3333/node_modules/.sanity/vite/deps/sanity-plugin-icon-picker.js?v=d414d840:8791:33

Looking at the changelog on Sanity, it appears this PR updating how imports work related to their auto-updating functionality may have triggered it: sanity-io/sanity#7187

Either way, would it be possible to address this so we can update to the newer versions of Sanity Studio?

@clinejj
Copy link
Author

clinejj commented Jul 26, 2024

Actually, it seems this was caused by sanity-io/sanity#7172 where they changed the Vite config to add conditions.

A similar issue was resolved in Storybook here: storybookjs/storybook#28581

I'm talking to Sanity support to see if this is an issue on their side, but it also might be related to how this plugin loads React possibly?

@notflip
Copy link

notflip commented Jul 29, 2024

@clinejj Which version was the last one that was working for you? I went back to 3.48.1 and the issue remains there.

@clinejj
Copy link
Author

clinejj commented Jul 29, 2024

I had it working in 3.51.0

@clinejj
Copy link
Author

clinejj commented Aug 2, 2024

This should be resolved in sanity 3.52.3+ (see release notes), fixed in this PR: sanity-io/sanity#7267

@clinejj clinejj closed this as completed Aug 2, 2024
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