Closed NashJames closed 1 year ago
Can you provide a reproducible example using codesandbox.io?
@NashJames
Just spent an hour trying. Hit one error on the sandbox, and another on github codespaces. No idea what caused either.
@NashJames I don't have any problems locally but I have problems on codesandbox example
I don't know how to solve it, if you solved it please share your answer.
thx!
For the time being, my plan is to use it without language support. If I ever give it another go and figure out the cause, I’ll come back and let you know.
Up to you if you wish to close this. I can always reopen if I do figure it out.
also using parcel and i got the error
here is the actual error
UPDATE: bump parcel to 2.8 and run rm -rf .parcel-cache node_modules package-lock.json fixed the issue
Thanks @miguelski. I'm assuming this is the correct fix but we're not in a position to upgrade parcel due to another bug. So I can't test.
I'll consider this fixed and close the issue and make a note in our project readme.
What worked for me was manually editing the Yarn lockfile (yarn.lock
) to remove any entries which had >1
version numbers that were conflicting (eg. @lezer/common@1.0.2
and @lezer/common@1.0.3
) and then re-running yarn install
to install the latest version.
Often I use Yarn Resolutions or pnpm Overrides to force the versions of transitive dependencies, which avoids this problem when upgrading dependencies. However, like some others in this thread, I have a dependency on older (pre-v1) versions of @lezer/common
and @lezer/lr
packages via Parcel 😨 So for these packages, Yarn Resolutions and pnpm Overrides cannot be used, because they will cause incompatibilities with the @mischnic/json-sourcemap
dependency from Parcel.
So manual upgrades for now until we can either remove the Parcel dependency or upgrade it (currently it's pinned on an old version from a different dependency).
So this error appears in the console on every page load when trying to load a language extension on both firefox and chrome (although chrome defines it as
Codemirror plugin crashed: TypeError: tags4 is not iterable
).I've tried using
loadLanguage('json')
from @uiw/codemirror-extensions-langs andjson()
from @codemirror/lang-json. No formatting is applied. The code mirror appears to work correctly.Error screenshot
![Screenshot 2022-11-10 at 11 56 10](https://user-images.githubusercontent.com/37304960/201086474-fafa63b3-efba-4155-b65a-f37fb60c05d1.png)Also, I've written some code to determine language based on file extension like below, but I have to write a huge type for it because
loadLanguage()
doesn't allow strings unless they match a type. You can't usetypeof langNames
because it's formatted with()[]
. Adding a type to the repo would be very helpful.