Skip to content

Unable to extract Sanity schema after installing sanity-range-slider #93

@rcmaples

Description

@rcmaples

Sanity v3.62.3
sanity-range-slider v1.0.10

Description

Studio fails to build after installing and implementing sanity-range-slider. The error seems related to Shopify's Polaris:
mql.addEventListener is not function

Reproduction Steps

  1. Install sanity-range-slider into a Studio project:
    ╰→ npm install @frontvibe/sanity-plugin-range-slider
  2. Add the plugin to your sanity config:
// sanity.config.ts/js
import {rangeSlider} from '@frontvibe/sanity-range-slider'

export default defineConfig({
    ...,
    plugins: [
        rangeSlider(), 
        ...
    ]
})
  1. Attempt to build or extract the schema
    ╰→ npm run dev | npm run build | sanity schema extract (any of them)

  2. Notice you receive an error:

❌️ Failed to extract schema

TypeError: Failed to load configuration file "~/my-project/sanity.config.ts":
mql.addEventListener is not a function
    at ~/my-project/node_modules/@shopify/polaris/build/cjs/utilities/breakpoints.js:55:11
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (~/my-project/node_modules/@shopify/polaris/build/cjs/utilities/breakpoints.js:45:27)
    at Object.newLoader [as .js] (~/my-project/node_modules/esbuild-register/dist/node.js:2262:9)
    at extensions..js (~/my-project/node_modules/esbuild-register/dist/node.js:4833:24)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions