-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make deno installable in stackblitz #26894
Comments
What happens if you run the below commands:
|
First hurdle: I cannot download straight into Stackblitz due to lack of CORS headers from Deno's download site:
Workaround: I can download to my local computer and then "upload" into Stackblitz env (it stores things in IndexedDB I think so I'm really just "copying" file(s) into web storage on my local computer). Second hurdle: Stackblitz doesn't support "uploading" files larger than 10MB and deno.zip is ~50MB.
Third hurdle: Stackblitz env doesn't have Workaround: I can unzip on my local machine, split the deflated curl -o deno.zip "https://dl.deno.land/release/$(curl -s https://dl.deno.land/release-latest.txt)/deno-x86_64-unknown-linux-gnu.zip"
unzip deno.zip
split -b10m deno # produces files named xaa, xab, ..., xan # deno-pieces contains the uploaded xa* files
❯ cat deno-pieces/* > deno.zip Fourth hurdle: The
I tried combing pieces one at a time but then Stackblitz froze and reloading the env didn't work (usually the files are still there but Stackblitz must have detected a problem with them and deleted them). I suspect that Stackblitz has done some special stuff with their web containers to make larger binaries like ❯ ls -la /usr/local/bin
total 2
drwxr-xr-x 1 root root 13 Nov 26 10:56 ./
drwxr-xr-x 1 root root 2 Nov 26 10:56 ../
-rwxr-xr-x 1 root root 12 Nov 26 10:56 code*
-rwxr-xr-x 1 root root 1601 Nov 26 10:56 google-chrome*
-rwxr-xr-x 1 root root 12 Nov 26 10:56 jq*
-rwxr-xr-x 1 root root 12 Nov 26 10:56 loadenv*
-rwxr-xr-x 1 root root 12 Nov 26 10:56 node*
lrwxrwxrwx 1 staff staff 38 Nov 26 10:56 npm@ -> ../lib/node_modules/npm/bin/npm-cli.js
lrwxrwxrwx 1 staff staff 38 Nov 26 10:56 npx@ -> ../lib/node_modules/npm/bin/npx-cli.js
lrwxrwxrwx 1 staff staff 37 Nov 26 10:56 pnpm@ -> ../lib/node_modules/pnpm/bin/pnpm.cjs
lrwxrwxrwx 1 staff staff 37 Nov 26 10:56 pnpx@ -> ../lib/node_modules/pnpm/bin/pnpx.cjs
-rwxr-xr-x 1 root root 12 Nov 26 10:56 python3*
-rwxr-xr-x 1 root root 12 Nov 26 10:56 wasm*
-rwxr-xr-x 1 root root 12 Nov 26 10:56 xdg-open*
lrwxrwxrwx 1 staff staff 37 Nov 26 10:56 yarn@ -> ../lib/node_modules/yarn/dist/yarn.js |
Ah, ok. Stackblitz WebContainer is not like docker container. It's not based on linux or any operating system, but it simulates Node.js using browser's JS engine. It can't execute binary executables like
That sounds correct. I think deno doesn't work in stackblitz unless stackblitz team does a similar work about Deno, simulating Deno APIs on browsers. |
Attempting to install Deno inside a Stackblitz Web Container fails immediately (note that currently
curl
in a Stackblitz Web Container environment doesn't support-f
nor-S
):Inspecting network traffic for the browser document via DevTools reveals that the first issue is a CORS issue:
I then tried pasting the contents of https://deno.land/install.sh into a file and running it directly:
For reference (and as the install.sh script might change with time), here is line 7:
The Stackblitz Web Container shell (
/bin/jsh
/) appears to have limited functionality but as Stackblitz supports Node.js it seems to me that supporting Deno should also be feasible.It might require some special setup from Stackblitz though. I've also created stackblitz/webcontainer-core#1608.
The text was updated successfully, but these errors were encountered: