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.