Stream: contributing

Topic: Overly strict web REPL error


view this post on Zulip Brian Carroll (Aug 02 2023 at 13:57):

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.

view this post on Zulip Anton (Aug 02 2023 at 14:09):

The ":warning:️ This web REPL misses som..." message is always present, it's static HTML.

view this post on Zulip Anton (Aug 02 2023 at 14:10):

The CSS makes it so that you need to scroll to see it, which is not ideal. I'll make an issue for that.

view this post on Zulip Anton (Aug 02 2023 at 14:15):

#5724

view this post on Zulip Himanshu Kumar (Aug 02 2023 at 15:56):

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.

view this post on Zulip Anton (Aug 02 2023 at 16:09):

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!

view this post on Zulip Brian Carroll (Aug 02 2023 at 16:35):

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!

view this post on Zulip Brian Carroll (Aug 02 2023 at 16:37):

Ok well the CSS fix is great but the problem with definitions is still there!

view this post on Zulip Brian Carroll (Aug 02 2023 at 16:38):

They should work as long as there is a final expression but they don't.

view this post on Zulip Brian Carroll (Aug 02 2023 at 16:40):

So this broke at some point.

view this post on Zulip Brian Carroll (Aug 02 2023 at 16:42):

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?

view this post on Zulip Folkert de Vries (Aug 02 2023 at 16:44):

parser changes?

view this post on Zulip Brian Carroll (Aug 02 2023 at 16:48):

Could be, I suppose.

view this post on Zulip Brian Carroll (Aug 02 2023 at 16:49):

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.

view this post on Zulip Brian Carroll (Aug 02 2023 at 17:35):

@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

view this post on Zulip Ayaz Hafiz (Aug 02 2023 at 18:30):

Richard also overhauled the state transitions in the repl so that is also a possible source

view this post on Zulip Richard Feldman (Aug 02 2023 at 20:51):

the state transition stuff is only used in the CLI repl at the moment

view this post on Zulip Anton (Aug 04 2023 at 07:47):

Your snippet works for me @Brian Carroll

x = 4
y = 5
x+y

Screenshot_20230804_094530.png
Could something be cached on your end?

view this post on Zulip Brian Carroll (Aug 04 2023 at 13:03):

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