🐛 add null check for csrf element content#459
Merged
Conversation
parrotmac
commented
Apr 2, 2026
Comment on lines
-699
to
-702
| } else if (this.#route.protocol == "wss:") { | ||
| this.#route.protocol = "https:"; | ||
| } else if (this.#route.protocol == "ws:") { | ||
| this.#route.protocol = "http:"; |
Contributor
Author
There was a problem hiding this comment.
Should the build process have removed these lines? Or did I mess something up?
Collaborator
There was a problem hiding this comment.
Ah yeah that's fine. The server component runtime is built fresh on every release so the releases are never out of sync but between releases sometimes we forget to run the build and commit the artefact. It's kinda an awkward dance at the moment, but yeah this change is expected don't worry!
Collaborator
|
Oh thank you, that was a silly mistake. Good catch! 💕 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
On a fresh clone of the lustre repo, when running e.g.
examples/06-server-components/05-publish-subscribe(also happening on at least06-/{04-,06-}) the following is thrown in the browser console:This appears to happen if the csrf meta element isn't found, so
metais null here.Fix
Added ONLY optional chaining to
src/lustre/runtime/client/server_component.ffi.mjs, then rangleam run -m build, resulting in all other changes present.Validating this fix also required updating
mistto>= v6.0.0, though that appears to be a separate issue.