Open adalmagro opened 7 months ago
Hey !
Can you tell me which version of sanity are you using ? This bug was introduced with the last changes on the sanity structure tool.
Are you on the v1.1.0 of the plugin ? Normally this bug has been fixed on the last version https://github.com/nuagedelait/sanity-pagebuilder/commit/ee1823fb4ea0ce299ef73cbda7eb1b64f6367ef2
Hi, yep, the plugin version is 1.1.0 and Sanity version is the latest 3.30.0
I resolved this by adding a staging a prod workspace:
[
{
name: 'pb-prod',
title: 'Pagebuilder-Production',
basePath: '/production',
projectId: '#######',
dataset: 'production',
plugins: [
structureTool(),
pagebuilderTool({
addBlocksSchemas: [],
addContentSchemas: [],
addManagmentSchemas: [],
api: 'sanity api version, default : `v2023-08-01`',
// languages: [],
}),
],
// schema: {
// types: schemaTypes,
// },
},
{
name: 'pb-staging',
title: 'Pagebuilder-Staging',
projectId: '######',
dataset: 'production',
basePath: '/staging',
plugins: [
structureTool(),
pagebuilderTool({
addBlocksSchemas: [],
addContentSchemas: [],
addManagmentSchemas: [],
api: 'sanity api version, default : `v2023-08-01`',
// languages: [],
}),
],
// schema: {
// types: schemaTypes,
// },
},
]
This goes into the defineConfig in sanity.config.ts
The documentation on this from Sanity is inaccurate. it has a couple of syntax errors. I put in a request to fix that too.
I ran into the next error... but new errors are still progress. I hope this helps.
I think the problem is the basepath
attribute of the configuration (I always have one because all my studios are on a subpath).
Can you try your previous configuration and add a basepath attribute ? I will make some ajustement next month if I have time.
That worked for me but now I get a different issue.
export default defineConfig(
{
name: 'production',
title: 'Pagebuilder-Production',
basePath: '/production',
projectId: '<ProjectId>',
dataset: 'production',
plugins: [
// structureTool(),
visionTool(),
pagebuilderTool({
addBlocksSchemas: [],
addContentSchemas: [],
addManagmentSchemas: [],
}),
],
schema: {
types: schemaTypes,
},
},
)
I added the visionTool() because I was getting an error saying I had no tools installed.
Either way I still cannot create
anything in the docs. When I click create
then any of the document types listed, the url changes but nothing happens on the screen.
Hey I released v1.1.1, can you try it ?
1.1.1 resolved the issue!!!!! @nuagedelait THANK YOU!!!! MERCI!!!!! for the records, I needed both structure builder and pagebuilder tool configured
export default defineConfig(
{
name: 'production',
title: 'Pagebuilder-Production',
basePath: '/production',
projectId: '<ProjectID>',
dataset: 'production',
plugins: [
structureTool(),
visionTool(),
pagebuilderTool({
addBlocksSchemas: [],
addContentSchemas: [],
addManagmentSchemas: [],
}),
],
schema: {
types: schemaTypes,
},
},
)
Great :) there are still some minor bugs that I found testing with a clean sanity project (I used it with a Nextjs all the time and forgot to test it out of the framework). I will release another version soon as soon as I have a little more time
Hi!, Now it works for me with version 1.1.1 and same configuration just initializing as below:
pagebuilderTool({ addBlocksSchemas: [], addContentSchemas: [], addManagmentSchemas: [], }),
Thank you very much!
Hi, I am getting the following error after installing the plugin:
` Error: Could not resolve workspace 'default':
default: Could not resolve workspace 'default':
An error occurred while resolving 'tools' from default > sanity-plugin-pagebuilder: Cannot read properties of undefined (reading 'structure')
at http://localhost:3333/node_modules/.sanity/vite/deps/chunk-2ZNB6QEX.js?v=2f0e0eb2:156085:15 at http://localhost:3333/node_modules/.sanity/vite/deps/chunk-VTEDXRNU.js?v=2f0e0eb2:2118:31 at OperatorSubscriber2._this._next (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-VTEDXRNU.js?v=2f0e0eb2:1197:9) at Subscriber2.next (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-VTEDXRNU.js?v=2f0e0eb2:1043:12) at http://localhost:3333/node_modules/.sanity/vite/deps/chunk-VTEDXRNU.js?v=2f0e0eb2:2206:26 at OperatorSubscriber2._this._next (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-VTEDXRNU.js?v=2f0e0eb2:1197:9) at Subscriber2.next (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-VTEDXRNU.js?v=2f0e0eb2:1043:12) at Observable2._subscribe (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-VTEDXRNU.js?v=2f0e0eb2:1774:18) at Observable2._trySubscribe (http://localhost:3333/node_modules/.sanity/vite/deps/chunk-VTEDXRNU.js?v=2f0e0eb2:1314:19) at http://localhost:3333/node_modules/.sanity/vite/deps/chunk-VTEDXRNU.js?v=2f0e0eb2:1308:115 `
My
sanity.config.ts
is as follows: `import {defineConfig} from 'sanity' import {structureTool} from 'sanity/structure' import {visionTool} from '@sanity/vision' import {schemaTypes} from './schemas' import { pagebuilderTool } from '@nuagedelait/sanity-pagebuilder'export default defineConfig({ name: 'default', title: 'XXXXXXXXX',
projectId: 'XXXXXXXXXXXX', dataset: 'XXXXXXXXXXXXXXX',
plugins: [structureTool(), visionTool(), pagebuilderTool()],
schema: { types: schemaTypes, }, })`
I am newcome to sanity. Any help please?