Can't get lang-example highlighting to work in v6

I followed this tutorial to bundle codemirror with rollup, and then tried to replace the javascript highlighting with the the lang-example package.
However, I see no highlighting at all.

Here is my project repo
Steps I take to build it:

  • cd lang-example && yarn && yarn run prepare && cd …
  • yarn && yarn rollup -c

Now when I open my web page, I have 0 errors in the js console but no highlighting either and I can’t figure out why.

Any help would be greatly appreciated.

Not sure what might be happening, but I noticed that the lang-example package hadn’t been updated for version 0.19. I did so, and it seems to work fine in for me locally. I suspect in your repository the problem is that the lang-example subdirectory has its own separate installation of the @codemirror packages, causing multiple instances of, for example, @codemirror/state to be loaded (which tends to break things).

Thanks. Indeed it was the @codemirror/ packages from the subdirectory being loaded again…
Do you happen to know how to tell rollup to ignore the node_modules from the subdirectory?
I used node-resolve’s dedupe again to try and prevent duplication of any package loaded by the subdirectory but it’s definitely a janky solution.

I think the link: dependency is the issue—that will make yarn leave that package’s dependencies isolated. If you want to include your language in your project, just don’t give it its own package.json. If you do want it as a separate package, install it as normal. Or manually mess with the node_modules directories so that it doesn’t have one.

Ah I understand. I will avoid using link: then.
Simply importing dist/index.js directly from the path seems to work great.
Thank you for the help!