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

Wrong package used sanity/structure instead of @sanity/structure #64

Open
tlazarov-whiskypartners opened this issue Jan 25, 2024 · 4 comments

Comments

@tlazarov-whiskypartners

Describe the bug

The plugin tries to find sanity/structure, but the package is now named @sanity/structure.

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?

10.2.4
v20.11.0

Error message

sanity:dev:   The plugin "vite:dep-pre-bundle" was triggered by this import
sanity:dev: 
sanity:dev:     ../../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]_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
@SimeonGriggs
Copy link
Collaborator

Can't recreate the error.

Started a fresh Studio and installed this plugin without error.

Have you tried clearing node_modules and reinstalling all packages?

@apclarkk
Copy link

apclarkk commented Feb 9, 2024

Experiencing identical issue with a fairly new studio install and after attempting to use sanity-io/orderable-document-list. Cleared node_modules and reinstalled within no change :/
Any help would be appreciated ~

  • Sanity: ^3.23.4
  • Node: v20.9.0
  • npm: 10.1.0
  • Vite: ^5.0.8
  • MacOS 13.5.1
✘ [ERROR] Missing "./structure" specifier in "sanity" package [plugin vite:dep-pre-bundle]

    node_modules/@sanity/orderable-document-list/lib/index.esm.js:9:30:
      9 │ import { usePaneRouter } from 'sanity/structure';
        ╵                               ~~~~~~~~~~~~~~~~~~

✘ [ERROR] Missing "./structure" specifier in "sanity" package [plugin vite:dep-pre-bundle]

    node_modules/sanity-plugin-utils/lib/index.esm.js:5:30:
      5 │ import { usePaneRouter } from 'sanity/structure';
        ╵                               ~~~~~~~~~~~~~~~~~~

12:27:58 PM [vite] error while updating dependencies:
Error: Build failed with 2 errors:
node_modules/@sanity/orderable-document-list/lib/index.esm.js:9:30: ERROR: [plugin: vite:dep-pre-bundle] Missing "./structure" specifier in "sanity" package

@Jamiewarb
Copy link

Jamiewarb commented Feb 22, 2024

Upgrading to the latest version of Sanity (3.29.1 at the time) fixed this for me. I was on 3.21.3, which pre-dates the internal migration to sanity/structure, and was therefore causing this error.

If you're getting this, check you're on Sanity version v3.24.1 or higher. This version marks the internal migration to sanity/structure

@apclarkk As you're on 3.23.4, upgrading to at least 3.24.1 should solve it

@apclarkk
Copy link

Will give this a try, thank you @Jamiewarb!

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

4 participants