winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.97k stars 196 forks source link

Wing Console: `Unexpected end of JSON input` #6010

Closed meirdev closed 6 months ago

meirdev commented 6 months ago

I tried this:

I don't know what steps to take to reproduce the problem exactly, it was when I tried to play a bit with ex.React to run a NextJS project.

This happened:

Unexpected end of JSON input when I try to run the Console.

I expected this:

No response

Is there a workaround?

To remove the .state dir.

Anything else?

As far as I can tell, the problem is that somehow an empty .state/*/state.json file is saved and the console tries to load it.

Wing Version

0.61.18

Node.js Version

v20.11.0

Platform(s)

MacOS

Community Notes

ekeren commented 6 months ago

It happened to me yesterday on the wingly.

@ainvoner I have a feeling it happens often, and should be fixed ASAP. (Based on my own experience)

eladb commented 6 months ago

Not sure the fix should be in the console. @Chriscbr seems like we need the simulator to be more resilient to corrupted state.

Chriscbr commented 6 months ago

I'm able to repro the error on my machine. It happens when you have an app with a bucket:

bring cloud;

new cloud.Bucket();

With the target/ directory is empty, run wing it to start the console. Then press Ctrl + C to stop the Wing Console. Then run wing it again, and the error appears.

monadabot commented 6 months ago

Congrats! :rocket: This was released in Wing 0.62.3.