Closed steveluscher closed 5 months ago
This happens on every project
This happens on every project
I wonder if that's even true. I haven't tested this rigorously, but I seem to remember forking an await-using sandbox like this one, and having it go from not working to… working.
I'm taking a look. It looks like it only affects the TS language server, meaning that the editor is giving an error but the project should work as expected.
This is so interesting! TypeScript just doesn't recognize the await
keyword at all, even though it's defined in its parser. I'm getting closer though.
Wooow, I finally found the bug to this. Since TypeScript 5, TypeScript uses a keyword list for await
to know if something is a keyword of identifier. Our transpiler in Nodebox mistakingly transpiles the TypeScript source code, though. As a result, you get this:
Nodebox:
Real source code:
await
was replaced with yield
. For now, I've downgraded TypeScript to fix it, and we're going to build a fix in our transpiler.
Fix should be live now!
Thank you!
Description of the problem
Using the ‘Vanilla TypeScript’ template and authoring a sandbox with the
await
keyword, I get this TypeScript error:How has this issue affected you? What are you trying to accomplish?
I can't create sandboxes that use async/await.
To Reproduce
https://codesandbox.io/p/sandbox/hungry-forest-7djrph