fddigital-uk / sanity-plugin-visual-options

19 stars 7 forks source link

Missing CSS definition? #5

Closed GarethChetwood closed 3 years ago

GarethChetwood commented 3 years ago

Hi there I have just started using this wonderful plugin however am getting warnings in the console when I run sanity start, they seem to relate to a css media query:

Warning in ./node_modules/@sanity/css-loader?modules&localIdentName=[name]_[local]_[hash:base64:5]&importLoaders=1&sourceMap!./node_modules/postcss-loader/lib??ref--1-oneOf-1-2!./node_modules/sanity-plugin-visual-options/lib/components/VisualOptions.css
(Emitted value instead of an instance of Error) postcss-custom-media: /Users/gareth/Documents/Workspace/chetwood-pws/chetwood-pws-sanity/node_modules/sanity-plugin-visual-options/lib/components/VisualOptions.css:29:5: Missing @custom-media definition for '--min-medium'. The entire rule has been removed from the output.
 @ ./node_modules/sanity-plugin-visual-options/lib/components/VisualOptions.css 2:14-218 21:1-42:3 22:19-223
 @ ./node_modules/sanity-plugin-visual-options/lib/components/VisualOptions.js
 @ ./node_modules/sanity-plugin-visual-options/lib/components/index.js
 @ ./node_modules/sanity-plugin-visual-options/lib/index.js
 @ ./node_modules/sanity-plugin-visual-options/lib (all:part:@sanity/base/schema-type)
 @ ./schemas/schema.js (part:@sanity/base/schema)
 @ ./node_modules/@sanity/default-layout/lib/util/getNewDocumentModalActions.js
 @ ./node_modules/@sanity/default-layout/lib/DefaultLayout.js
 @ ./node_modules/@sanity/default-layout/lib/Root.js (part:@sanity/base/root)
 @ ./node_modules/@sanity/base/lib/components/SanityRoot.js (part:@sanity/base/sanity-root)
 @ ./node_modules/@sanity/server/lib/browser/entry-dev.js
 @ multi ./node_modules/normalize.css/normalize.css ./node_modules/@sanity/server/lib/browser/entry-dev.js

Any help would be appreciated.

nicktaylor commented 3 years ago

Hey @GarethChetwood, could you post your Sanity Studio version for me, please? Does everything else seem to be working OK?

GarethChetwood commented 3 years ago

Hi @nicktaylor, this is from my package.json

image

Everything else seems to be working fine yes. Might be worth noting that the warning repeats three times as well. This is from the browser console:

./node_modules/@sanity/css-loader?modules&localIdentName=[name]_[local]_[hash:base64:5]&importLoaders=1&sourceMap!./node_modules/postcss-loader/lib??ref--1-oneOf-1-2!./node_modules/sanity-plugin-visual-options/lib/components/VisualOptions.css(Emitted value instead of an instance of Error) postcss-custom-media: /Users/gareth/Documents/Workspace/chetwood-pws/chetwood-pws-sanity/node_modules/sanity-plugin-visual-options/lib/components/VisualOptions.css:13:3: Missing @custom-media definition for '--min-medium'. The entire rule has been removed from the output.
./node_modules/@sanity/css-loader?modules&localIdentName=[name]_[local]_[hash:base64:5]&importLoaders=1&sourceMap!./node_modules/postcss-loader/lib??ref--1-oneOf-1-2!./node_modules/sanity-plugin-visual-options/lib/components/VisualOptions.css(Emitted value instead of an instance of Error) postcss-custom-media: /Users/gareth/Documents/Workspace/chetwood-pws/chetwood-pws-sanity/node_modules/sanity-plugin-visual-options/lib/components/VisualOptions.css:21:5: Missing @custom-media definition for '--min-medium'. The entire rule has been removed from the output.
./node_modules/@sanity/css-loader?modules&localIdentName=[name]_[local]_[hash:base64:5]&importLoaders=1&sourceMap!./node_modules/postcss-loader/lib??ref--1-oneOf-1-2!./node_modules/sanity-plugin-visual-options/lib/components/VisualOptions.css(Emitted value instead of an instance of Error) postcss-custom-media: /Users/gareth/Documents/Workspace/chetwood-pws/chetwood-pws-sanity/node_modules/sanity-plugin-visual-options/lib/components/VisualOptions.css:29:5: Missing @custom-media definition for '--min-medium'. The entire rule has been removed from the output.

Thanks

fddigital-uk commented 3 years ago

Thanks @GarethChetwood for this, I'll be looking further into a solution shortly. I've confirmed that something has changed in the latest version of Sanity Studio to cause that to break.

fddigital-uk commented 3 years ago

@GarethChetwood the latest version 0.8.4 should now resolve the issue you were seeing relating to the responsive layout of the component. Thanks again.