-1

I have

Parsing erros: Unexpected token, expected ","

in the project I code in codesandbox.io. I have just connected codesandbox project into github repository and it throws such error which I cannot figure-out. Can You please suggest what is wrong and how to fix it?

enter image description here

James Z
  • 12,209
  • 10
  • 24
  • 44
marcinb1986
  • 708
  • 1
  • 11
  • 30
  • Try maybe using this as your import statement instead: ```import React, { StrictMode } from "react";``` – man517 Dec 18 '22 at 20:56

1 Answers1

1

Please don't post screenshots of code. It's usually actually faster to just copy-paste in your code, and you can use three backticks both above and below the code to format it correctly.

Trust your error messages to point you in the right direction: it's telling you that your exclamation mark is invalid. The ! is a non-null assertion operator, it doesn't belong there because you're not accessing a property that TS might think is null. The parser thinks you meant to do something like (rootElement, !someOtherThing), hence the error saying it expected a comma.

Zac Anger
  • 6,983
  • 2
  • 15
  • 42