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

Workspace not defined #232

Open
Nichtkunst opened this issue Mar 6, 2023 · 3 comments
Open

Workspace not defined #232

Nichtkunst opened this issue Mar 6, 2023 · 3 comments
Labels

Comments

@Nichtkunst
Copy link

Nichtkunst commented Mar 6, 2023

Hello,

I used the template. Clean install. Locally everyhting works. Then deploy npx sanity deploy.

  1. Have to fix all paths the related to the deployment, sanity, to absolute paths cause of vite - done. I can deploy.
  2. Studios runs but the preview doesn't work. Workspace not found

image

The only things I changed are the

  • title of the studio
  • .env vars to SANITY_* (yet this doesn't fix the issue when I deploy the CLI reads it out but the studio complains it is undefined - therefore I just write the values plain)

What causes the Workspace not found - I can't find anything that makes sense to me cause it is the starter. Please help.

git-repo: link

`import { visionTool } from '@sanity/vision'
import { defineConfig } from 'sanity'
import { deskTool } from 'sanity/desk'
import { unsplashImageAsset } from 'sanity-plugin-asset-source-unsplash'

import { apiVersion, dataset, previewSecretId, projectId } from './lib/sanity.api'
import { previewDocumentNode } from './plugins/previewPane'
import { productionUrl } from './plugins/productionUrl'
import { settingsPlugin, settingsStructure } from './plugins/settings'
import authorType from './schemas/author'
import postType from './schemas/post'
import settingsType from './schemas/settings'

const title =
process.env.SANITY_STUDIO_TITLE || 'Blog Kerstin Eibel'

export default defineConfig({
basePath: '/studio',
projectId: "XXXX-XXXX",
dataset: "production",
title,
schema: {
types: [authorType, postType, settingsType],
},
plugins: [
deskTool({
structure: settingsStructure(settingsType),
defaultDocumentNode: previewDocumentNode({ apiVersion, previewSecretId }),
}),
settingsPlugin({ type: settingsType.name }),
productionUrl({
apiVersion,
previewSecretId,
types: [postType.name, settingsType.name],
}),
unsplashImageAsset(),
visionTool({ defaultApiVersion: apiVersion }),
],
})`

@Nichtkunst
Copy link
Author

It was a god damn CORS issue. Closed! The env. vars issue remains.

@Codeshark-NET
Copy link
Contributor

Did you happen to resolve this @Nichtkunst? 🙂

@Nichtkunst
Copy link
Author

Nichtkunst commented Jul 19, 2023

Edit: yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants