Problems understanding gutters

I want to create a gutter for breakpoints, so I first wanted to test gutters in general and tried to make a simple lineNumbers gutter:
export const breakPointGutter = lineNumbers({formatNumber: (n) => "#"+n});

But I keep getting this error: TypeError: Cannot read property 'extension' of undefined".

What could be the reason for this? (I also tried doing passing an empty gutter configuration: gutter({}) but I get the same error)

Also I think the documentation would really benefit of a gutter example

I think you’re running into a package manager problem where you end up with multiple versions of @codemirror/state installed, which leads to precisely this error. Removing node_modules and your package lock and reinstalling tends to solve it.

I’ve just tried that, unfortunately I end up with the same error once again.

So are there multiple versions of @codemirror/state under your node_modules folder? (find node_modules | grep "@codemirror/state$" on a unix system)

yes, gutter seems to use it’s own version of state (there is only one different version, the main one I’m using as well) - is there an easy way to fix this?

What do your top-level dependencies look like? And which package manager are you using?

I’m currently using yarn as my package manager
This was the result of the grep:

find node_modules | grep "@codemirror/state$"
node_modules/@codemirror/gutter/node_modules/@codemirror/state
node_modules/@codemirror/state

And these are my codemirror dependencies (Should all be the latest version)

 "dependencies": {
    "@codemirror/basic-setup": "^0.17.1",
    "@codemirror/commands": "^0.17.4",
    "@codemirror/gutter": "^0.18.0",
    "@codemirror/history": "^0.17.2",
    "@codemirror/matchbrackets": "^0.17.2",
    "@codemirror/state": "^0.17.2",
    "@codemirror/stream-parser": "^0.17.1",
    "@codemirror/theme-one-dark": "^0.17.5",
    "@codemirror/view": "^0.17.10",

You don’t want to mix 0.17 and 0.18 versions—I think if you move all your dependencies to 0.18.x this problem will go away.

Thanks a lot, it worked