Skip to content

Update comunica to latest#213

Merged
GCHQDeveloper81 merged 2 commits intomainfrom
update-comunica
May 1, 2026
Merged

Update comunica to latest#213
GCHQDeveloper81 merged 2 commits intomainfrom
update-comunica

Conversation

@GCHQDeveloper81
Copy link
Copy Markdown
Member

@GCHQDeveloper81 GCHQDeveloper81 commented May 1, 2026

The upgrade to comunica@5.2.0 turned out to have a few breaking changes, which are addressed by this PR.

Logger

This project has a logger that is used for "general logging" but also passed to comunica's engine so it can also write to the same logs. This has worked fine up to now because both loggers followed a fairly standard pattern , however comunica has now introduced a performance enhancement that expects the engine's logger to have a flush function among other things, which our logger doens't. These have been stubbed out for now (which means we don't get that functionality) - will revisit in the future.

Vite and LRU-CACHE

We started getting a warning after upgrading:

app:Module "node:diagnostics_channel" has been externalized for browser compatibility. Cannot access "node:diagnostics_channel.channel" in client code. See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.

Which eventually manifested as an error when we instantiated a Comunica engine. After a bit of research it turned out to be related to the lru-cache module, which has introduced conditional exports that were incompatible with the vite defaults, meaning some kind of node-specific functionality that was being picked up in the browser (almost certainly this was caused by this commit from a few weeks ago). Comunica's new release must've bumped this version and they've picked up the issue.

This was one of those really nasty bugs where the cause did not match the symptom, and how it manifests/the error it gives may differ depending on what the app is doing - bad news for anyone who misses the original warning.

The fix was just to be a bit more explicit in the vite config (see PR).

@GCHQDeveloper81 GCHQDeveloper81 merged commit c68e251 into main May 1, 2026
8 checks passed
@GCHQDeveloper81 GCHQDeveloper81 deleted the update-comunica branch May 1, 2026 12:10
@GCHQDeveloper81
Copy link
Copy Markdown
Member Author

GCHQDeveloper81 commented May 1, 2026

@rubensworks FYI - upgraded to 5.2.0, found a couple of breaking changes that may affect others. Workarounds described above, in case any other users have the same issues.

@rubensworks
Copy link
Copy Markdown

Thanks for the ping, that was an oversight indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants