RunJS is a JavaScript playground for macOS, Windows and Linux. Write code with instant feedback and access to Node.js and browser APIs.
@lasharela were you able to resolve this?
To try out things, top level await would be awesome. It is very annoying to write:
(async () => {
async function t() {}
await t();
})().catch(console.trace);
With top level await:
async function t() {}
await t();
@wc-matteo @timuric @jimmyn @hoegertn @letoast Top-level await is now supported. However, it's not compatible with displaying runtime values. For that reason, it is not enabled by default. You can enable top-level await from the settings:
Are you constantly seeing this issue, or is it just when you execute some particular code?
@juanjzb have you tried doing a fresh install of 2.8.0?
On the last version, playground is not showing results of nothing, and it only shows a loader in the top-right corner of the code editor
@brandonmcconnell this is one of the scenarios where a semi-colon is essential. You'll see the same error in any environment.
This issue occurs when the app is opened while an update is being installed. Version 2.8.0 addresses this issue.
@323zc please see: https://github.com/lukehaas/RunJS/issues/535
Try clicking on Clear
in the edit menu and then restarting the app.
@silver-mx thanks for the update. Are you able to successfully install NPM packages via the terminal?
This Code on formatting with alt + shift + f
,
let arr = [1,2,3];
arr.indexOf(1)
let cplxArr = [
{id: 1},
{id: 2},
{id: 3}
];
cplxArr.findIndex(el => el.id === 1);
produces the following which is wrong.
let arr = [1, 2, 3];
arr.indexOf(1);
arr.indexOf(1)
let cplxArr = [{ id: 1 }, { id: 2 }, { id: 3 }];
let cplxArr = [
cplxArr.findIndex((el) => el.id === 1);
using v 2.2.2.0
Resolved in the latest release.
@pjchender this is resolved in the latest release.
@juanjzb please provide your debug log:
update changelog
Please provide your debit log. You can get this via the help menu.
@btecu this is documented here: https://runjs.app/docs#tools
Ok, makes sense.
You can specify the version to install in the same way you would via the cli, for example react@17.0.0
Why do you have your system set to Spanish if you want to use apps in English?
Turning off runtime values would achieve the result you want:
There are some cases where someone would want to update or install a different version of a package they have already added. This behaviour caters for that.