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

vite Compliation error on sanity/structure #30

Closed
Jamiewarb opened this issue Jan 30, 2024 · 2 comments
Closed

vite Compliation error on sanity/structure #30

Jamiewarb opened this issue Jan 30, 2024 · 2 comments

Comments

@Jamiewarb
Copy link

Jamiewarb commented Jan 30, 2024

Description of error

There's an open PR here: sanity-io/sanity-plugin-documents-pane#64

It mentions an issue with sanity-plugin-utils. They say they think that where sanity/structure is used, the package should be @sanity/structure, in this file:

https://github.com/SimeonGriggs/sanity-plugin-utils/blob/main/src/hooks/useOpenInNewPane.tsx#L3

I'm not sure if that's the correct resolution or not. I had a look at changing the package to @sanity/structure, but that didn't seem to be the right fix

Which versions of Sanity are you using?

3.21.3

What operating system are you using?

MacOS

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

Node: 18.17.1
npm: 10.2.5
pnpm: 8.14.0

Error message

sanity:dev: The plugin "vite:dep-pre-bundle" was triggered by this import
sanity:dev:
sanity:dev: ../../node_modules/.pnpm/sanity-plugin-utils@1.6.4_@sanity[email protected][email protected]_react-fast-compare@3.2.2_react@18_dl6nsyrbpmk4iah6t67kasu2im/node_modules/sanity-plugin-utils/lib/index.esm.js:5:30:
sanity:dev: 5 │ import { usePaneRouter } from 'sanity/structure';
sanity:dev: ╵ ~~~~~~~~~~~~~~~~~~
sanity:dev:
sanity:dev: 3:56:38 AM [vite] error while updating dependencies:
sanity:dev: Error: Build failed with 2 errors:
sanity:dev: ../../node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1373:21: ERROR: [plugin: vite:dep-pre-bundle] Missing "./structure" specifier in "sanity" package
sanity:dev: ../../node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1373:21: ERROR: [plugin: vite:dep-pre-bundle] Missing "./structure" specifier in "sanity" package

@Jamiewarb Jamiewarb changed the title Incorrect sanity/structure package name vite Compliation error on sanity/structure Jan 30, 2024
@SimeonGriggs
Copy link
Owner

@Jamiewarb
Copy link
Author

Upgrading to the latest version of Sanity fixed this. Thanks for the assist Simeon

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