Closed mcbrwr closed 8 months ago
Hi @mcbrwr, I'm assuming based on the date of this post that it's installed v2.0.0 of the plugin, is that correct? Thanks!
Hi @mcbrwr, I'm assuming based on the date of this post that it's installed v2.0.0 of the plugin, is that correct? Thanks!
Hey @nicktaylor I'm not the original poster but stumbled across this because I am also experiencing this issue. I am using ^2.0.1
Thanks @MattWIP I've managed to replicate this, but haven't discovered what's causing the underlying issue yet. I've been a bit tight on time to try and resolve this.
A PR would be very welcome if you know what the issue might be. Thanks.
Hi @MattWIP / @mcbrwr, this should now be resolved in version 2.0.2. Please let me know if you are still having issues. Thanks a lot for reporting.
When in a NextJS project with JS configured instead of TS the plugin fails with an error: SyntaxError: Invalid or unexpected token
To reproduce:
Start a new NextJS project without Typescript:
Then cd into that dir and create sanity project, also without TypeScript:
Add a simple schema with just a title in /sanity/schema.js
Add the plugin to the project:
And add it to the sanity config:
Run the server and load the /studio url. It crashes with an "unexpected token" error:
Note:
When running this reproduction commands and choosing "Typescript: Yes" in both Next and Sanity the setup does work.