Registry / devops / gatsby-plugin-jss-provider

gatsby-plugin-jss-provider

JSON →
library1.0.10jsnpmunverified

A Gatsby plugin that wraps the root element in a react-jss JssProvider for JSS support. Version 1.0.10, last updated in 2019 with no recent releases. It provides custom configuration for JssProvider props, custom JSS instances, and optional CSS minification via csso. Unlike gatsby-plugin-jss, this plugin offers a customizable config module path and minification. Requires gatsby >2.0.0-alpha and react-jss >8.6.1. The package is minimal and may not be actively maintained.

npm install gatsby-plugin-jss-provider
INSTALL
IMPORT
SIG · GATSBY-PLUGIN-JSS-
G
gatsby-plugin-jss-provider
devopsjavascriptv1.0.10
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
module.exports = { plugins: ['gatsby-plugin-jss-provider'] }
import gatsbyPluginJssProvider from 'gatsby-plugin-jss-provider'
Used as a Gatsby plugin string, not a direct import. Add to gatsby-config.js's plugins array.

Adds JSS support to Gatsby by wrapping the root element in JssProvider with default settings.

// gatsby-config.js module.exports = { plugins: ['gatsby-plugin-jss-provider'], };
Debug
Known issues
gotchaIf you have a custom JSS configuration module, the path is relative to the project root, not the plugin.
fix
Set options.pathToConfigModule to a path like 'src/config/jss.js'.
affects: >=1.0.0
gotchaThe configuration module must export a function that takes a JSS instance and returns props for JssProvider.
fix
Ensure the module exports a function: module.exports = (jss) => { return { jss, ... }; }
affects: >=1.0.0
breakingVersion 1.0.0 removed the default JSS instance, requiring a config module to provide one.
fix
Create a config module that calls jss.setup() and returns { jss, generateId }.
affects: >=1.0.0
deprecatedThis plugin is no longer actively maintained. Consider migrating to gatsby-plugin-jss or a newer JSS integration.
fix
Switch to gatsby-plugin-jss (official) or use CSS-in-JS alternatives like Emotion or styled-components.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module '<path>' while resolving config module for gatsby-plugin-jss-provider
The path specified in options.pathToConfigModule is incorrect or the file does not exist.
fix
Verify the path is relative to the project root and the file exists and exports a function.
TypeError: jss.setup is not a function
The JSS instance passed to the configuration module is not a proper JSS object.
fix
Ensure react-jss is installed correctly and the config module receives the JSS instance as a parameter.
Upgrade
Version history
1.0.10latest on npm
Audit
Dependencies
gatsbyrequiredpeer dependency - required as a Gatsby plugin
react-jssrequiredpeer dependency - provides JSS integration for React
Agent activity
2 hits · last 30 days
node
2
Resources
gatsby-plugin-jss-provider — npm install gatsby-plugin-jss-provider · libregistry