This used to work in the web REPL, but now it is incorrectly identified as an error.
x = 4
y = 5
x+y
This produces the error message below, but I don't think it should!
⚠️ This web REPL misses some features that are available in the CLI (roc repl) like defining variables without a final expression, which will result in the "Missing Final Expression" error.
But what I typed in does have a final expression. This should work fine, and used to!
I think whatever is checking for this condition is too strict.
The ":warning:️ This web REPL misses som..." message is always present, it's static HTML.
The CSS makes it so that you need to scroll to see it, which is not ideal. I'll make an issue for that.
Hi anton, I would like to contribute on this issue(#5724). I am new to open source and would like to know how to run the project after making changes.
Hi @Himanshu Kumar,
Welcome to open source development :)
I've confirmed that your PR works through live editing https://www.roc-lang.org/repl in the browser.
Thanks for your help!
Anton said:
The ":warning:️ This web REPL misses som..." message is always present, it's static HTML.
Oh I see! I thought the error was persisting for some reason!
Ok well the CSS fix is great but the problem with definitions is still there!
They should work as long as there is a final expression but they don't.
So this broke at some point.
That HTML warning is about a feature we haven't implemented. But that is not what I intended to discuss in this thread.
What I'm saying is that the expected behaviour is broken.
What work has been done in the last few months that could cause a bug in the web REPL?
parser changes?
Could be, I suppose.
At this stage I think if we're going to fix it, it'll be a matter of making it work like the CLI repl rather than restoring the old behaviour.
@Himanshu Kumar if you want to run the web REPL locally there are instructions here:
https://github.com/roc-lang/roc/blob/main/crates/repl_wasm/README.md
Richard also overhauled the state transitions in the repl so that is also a possible source
the state transition stuff is only used in the CLI repl at the moment
Your snippet works for me @Brian Carroll
x = 4
y = 5
x+y
Screenshot_20230804_094530.png
Could something be cached on your end?
Yes, that works for me when I copy and paste it in! Thanks for testing.
:thinking:
The other day, I was having trouble with "up arrow" navigation, trying to fix a typo in the expression
When you have multiline input it's hard to go back to it and edit it
The up arrow takes you to the previous input - there's no way to go up or down within a single multiline expression.
So in the end, I think this is really a UI issue with multiline editing
Last updated: Jul 06 2025 at 12:14 UTC