#Sanity Studio Not working with deployed version of site

4 messages · Page 1 of 1 (latest)

silver token
#

Hi all I upgraded my blog from astro 3 to astro 4 and when I did that sanity and other plugins were not working once fixing everything for my local development environment. I deployed the changes and everything is working except for sanity studio these are the errors from the console not sure how to fix as it is working locally and only breaks when deploying through netlify. if anyone has any information that can help that would be greatly appreciated

brazen spindleBOT
#

Hi @silver token. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the information provided in the extracts, there are a few potential issues that could be causing your problem with Sanity Studio in your deployed Astro application.

  1. Isomorphic Packages: There's a reported issue with isomorphic packages like @sanity/client causing errors when used with Astro. The error window is not defined suggests that Astro is trying to execute code that is bundled for the browser by Snowpack, which can cause issues with isomorphic packages (source (https://github.com/withastro/astro/issues/459)).

  2. Adapter Configuration: There are several reported issues with deploying Astro applications using different adapters. Make sure your adapter is correctly configured for your deployment environment. For example, one user reported an issue with the Netlify adapter causing their application to crash after deployment (source (https://github.com/withastro/astro/issues/7638)).

  3. Node Version: Another user reported that removing type: module from their package.json file resolved a deployment issue they were experiencing. This was specifically related to using Node v16+ (source (https://github.com/withastro/astro/issues/7638)).

Without more specific information about your setup and the errors you're encountering, it's difficult to provide a more precise answer. I would recommend checking your adapter configuration and the version of Node you're using for deployment. If you're using isomorphic packages like @sanity/client, you may need to find a workaround for the issues described above.

#

If you're still experiencing issues, consider opening an issue on the Astro GitHub (https://github.com/withastro/astro/issues) or asking for help in the Astro Discord community.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: