Watch a live product demo 👀 See how Sanity powers richer commerce experiences

I’m experiencing an error when trying to deploy `sanity graphql deploy` and getting this error point towards a node_module ```import ColorPicker from '../components/input'; ^^^^^^ SyntaxErro...

17 replies
Last updated: Jan 16, 2021
I’m experiencing an error when trying to deploy
sanity graphql deploy
and getting this error point towards a node_module
import ColorPicker from '../components/input';
^^^^^^
SyntaxError: Cannot use import statement outside a module
Does anyone know what’s causing this issue. I have been fine with this studio until the moment.
Jan 15, 2021, 4:41 AM
It would appear so, but I can't see any direct imports in the published package... Could you paste the output of what
sanity versions
gives you when you run it in the studio folder?
Jan 15, 2021, 4:49 AM
@sanity/cli 2.1.4 (up to date)@sanity/base 2.1.6 (up to date)
@sanity/cli 2.1.4 (up to date)
@sanity/color-input 2.1.4 (up to date)
@sanity/components 2.1.4 (up to date)
@sanity/core 2.1.4 (up to date)
@sanity/default-layout 2.1.6 (up to date)
@sanity/default-login 2.1.4 (up to date)
@sanity/desk-tool 2.1.6 (up to date)
@sanity/vision 2.1.4 (up to date)
Jan 15, 2021, 4:51 AM
/Users/dustinsimensen/Documents/Final/studio/node_modules/sanity-plugin-color-picker/lib/schema/index.js:82
import ColorPicker from '../components/input';
^^^^^^
SyntaxError: Cannot use import statement outside a module

Jan 15, 2021, 4:51 AM
thats the full error
Jan 15, 2021, 4:51 AM
I had to completely remove it to move on
Jan 15, 2021, 4:57 AM
Oh, I see,
sanity-plugin-color-picker
is a community-contributed plugin - it seems to not compile the javascript sources to ES5 😕
I'll see if I can send a pull request to fix it, but I can't guarantee a swift resolution given it's not an official plugin
Jan 15, 2021, 5:02 AM
That’s okay, I don’t know why it’s there, honestly?
Jan 15, 2021, 5:03 AM
I just deleted it and two pieces of code that used it and didn’t do anything. Thanks.
Jan 15, 2021, 5:03 AM
I'm not sure? Was this project based on one of our starters?
Jan 15, 2021, 5:12 AM
It was not, no.
Jan 15, 2021, 5:12 AM
A teammate put the code in last night and it crashed my sanity
Jan 15, 2021, 5:12 AM
Aha
Jan 15, 2021, 5:13 AM
May I ask an unrelated question about Sanity Images inside the CMS?
Jan 15, 2021, 5:15 AM
Or should I ask in main channel?
Jan 15, 2021, 5:16 AM
Main channel would be best 🙂
Jan 15, 2021, 5:24 AM
Main channel would be best 🙂
Jan 15, 2021, 5:24 AM
[ for what it's worth, this is now fixed in the latest release of the mentioned plugin - https://github.com/edolyne/sanity-plugin-color-picker/pull/2 ]
Jan 16, 2021, 4:16 AM

Sanity– build remarkable experiences at scale

The Sanity Composable Content Cloud is the modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Related answers

Get more help in the community Slack

TopicCategoriesFeaturedRepliesLast Updated
After adding the subtitle and running this code npm run graphql-deploy It does nothingSep 15, 2020
how to limit a reference to just one entry in Studio reference input side versus the default as-many-entries-as-you-fill-in-an-array...Sep 18, 2020
Is it possible to fetch more than one "_type" using GROQ?Nov 2, 2020
I want to add a view with the Structure builder (S.view.component) where I list similar documents based on the title. What...Sep 23, 2020
Is there a structure builder example where the format of each preview for the document list is modified?Feb 3, 2021
I have an array of references to a country schema type but it always just returns NULL values for meJan 30, 2021
Hi, I need help with a query for getting the url of an image asset. Here is what I've been trying, but I only get the _ref...Dec 1, 2020
Sanity UI looks brilliant :smiley: Is something like the current date picker possible at the moment? I’m not sure if anicon...Dec 21, 2020
Hey everyone. I have been coding and may have potentially accidentally deleted something. Does anyone know how to resolve...Dec 26, 2020
Hello everyone and happy new year :raised_hands::skin-tone-2:, I have a problem with outputting Portable Text :disappointed:...Jan 1, 2021

Related contributions

Clean Next.js + Sanity app
- Template

Official(made by Sanity team)

A clean example of Next.js with embedded Sanity ready for recomposition.

Cody Olsen
Go to Clean Next.js + Sanity app

Blog with Built-in Content Editing
- Template

Official(made by Sanity team)

A Sanity-powered blog with built-in content editing and instant previews.

Go to Blog with Built-in Content Editing