Skip to content

Warnings at build time with Astro using embedded studio #290

@Lornz-

Description

@Lornz-

Describe the bug

I recently upgraded to version 3.2.0 to use embedded studio without the need for an SSR adapter. I successfully built the project, but I encountered a few warnings that caught my attention.

Export "structureLocaleNamespace" of module "node_modules/sanity/lib/_chunks-es/pane.mjs" was reexported through module "node_modules/sanity/lib/structure.mjs" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
Either change the import in "node_modules/sanity/lib/_chunks-es/pane.mjs" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.

and

10:36:54 [vite] dist/_astro/studio-component.cy3tc0Fv.js                                   4,520.35 kB │ gzip: 1,370.49 kB
10:36:54 [WARN] [vite]
(!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.

Are there any suggestions on how to set up rollup with vite to reconfigure output.manualChunks as suggested to ensure that pointed modules end up in the same chunk and simultaneously improve chunking?

To Reproduce

Steps to reproduce the behavior:

  1. Bump @astro/sanity to 3.2.0
  2. Setup Sanity Studio in embedded mode
  3. Add studioRouterHistory: 'hash'in sanity parameters of astro.config
  4. astro build in Terminal
  5. See output

Expected behavior

It should build without any warning.

Screenshots
If applicable, add screenshots to help explain your problem.

Image

Which versions of Sanity are you using?

@sanity/cli (global): 3.71.2 (latest: 3.74.1)
@sanity/astro: 3.2.0 (up to date)
@sanity/image-url: 1.1.0 (up to date)
@sanity/visual-editing: 2.12.12 (latest: 2.13.1)
sanity: 3.74.0 (latest: 3.74.1)

What operating system are you using?

MacOS Sequoia 15.2

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

npm 10.7.0
node v22.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions