Error that I don't know how to fix

I keep getting this error
image
[Unexpected Unicode character: U+2028. Did you mean ’ '?
image

Can’t find any fixes, looking for someone who can help
Thanks in advance :>,

4 Likes

It means you have an unsupported(?) character somewhere in line 59, probably one of the invisible characters. This can happen when you copy-paste stuff, try retyping the line.

3 Likes

Have you checked your strings for invalid characters?

RBX.Lua supports UTF-8 Unicode Encoding, you may have a character in the script that it does not support.

Since I cannot see the strings that you are parsing in, or the line numbers, I cannot tell you directly what the cause of the error is

3 Likes

Looks like you’re using a unicode line seperator instead of the typical carriage return + line feed. Roblox does not treat that like whitespace, apparently.

8 Likes

I believe that this error is coming from a larger issue.

Today, Roblox broke the chat CoreGui. Users are currently able to chat empty messages (i.e by pressing / and then enter without any actual text) because a carriage return character is automatically appended to the chatted string. This has broken numerous admin commands and more. See: Hitting enter in a textbox places a carriage return before finalizing input (broken again) - #34 by ForeverDev

I believe that this issue must be related. I just ran into the same problem a few minutes ago for the first time. I created a newline while coding by pressing enter, and a carriage return was inserted. I got the exact same error as OP:

Unexpected Unicode character: U+2028. Did you mean ’ '?

After deleting the stray carriage return, I was getting errors that didn’t make any sense. I got an error saying that I was missing an end on line 25, but my code was only 23 lines long and I clearly wasn’t missing an end.

Hopefully this gets resolved tomorrow morning because it seems that there is an underlying issue causing problems in multiple domains.

15 Likes

I’m having this exact same issue. It just started happening out of nowhere. It’s rather frustrating to code with this.

2 Likes

In the most recent studio update, for some odd reason, whenever you start a new line it will occasionally make a blank line in between? My temp fix is to just backspace the line and re-enter, however it is very annoying

image

6 Likes

I have the same issue, too. I see nothing can cause that error.

2 Likes

I cannot re write any of my code without getting this error. This one error has been frustrating me A LOT. I have tried different ways of writing my code but I always end up with this error. I really hope that if this is an issue on roblox’s end that they can fix it as soon as possible.

2 Likes

Yes this is unfortunately happening to me too and I have found a way to fix this error in your code. Just do CTRL + A then CTRL + C then CTRL + A then CTRL + DEL and CTRL + V.
You just have to clear your script and repaste it again.

11 Likes

Holy it actually worked! Thanks

Quick follow-up: I’m able to reproduce the insertion of the carriage return character 100% of the time by pressing Shift + Enter in the script editor.

7 Likes

Wow amazing that you found a way to reproduce this so quickly! :clap:
I just ran into this error myself. Really bad for work flow when you run into something and you know your code has no issues.

4 Likes