Git Product home page Git Product logo

webcontainer-core's Introduction

WebContainers

This repository serves as a central hub for the GitHub issues and bug reports related to WebContainers for easier tracking and communication.

For documentation, visit webcontainers.io where you'll find detailed information about WebContainers and the WebContainer API.

Learn more

Reach out

Changelog

The changelog is made available in our documentation.

webcontainer-core's People

Contributors

atian25 avatar ayrtonbardiot avatar danielroe avatar dannyfeliz avatar david-poindexter avatar davien21 avatar ericsimons avatar gauben avatar geromegrignon avatar jrvidal avatar kwintenp avatar nartc avatar samverschueren avatar sulco avatar sylwiavargas avatar wakeupmh avatar ycjcl868 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webcontainer-core's Issues

Modules fail without error

Describe the bug
I have attempted to execute the Node starter demo in Chrome using modules and it does not work.

Link to the blitz that caused the error
https://stackblitz.com/edit/node-v6m1qa

To Reproduce
Steps to reproduce the behavior:
I tried two different approaches:

  1. Add "types": "module" to the package.json file.
  2. Change the file name from index.js to index.mjs

In both approaches I attempted to execute these code samples:

import fs from "fs";
fs.readdir("./", function (err, list) {
  console.log(err);
  console.log("");
  console.log(list.join(", "));
});
import ("fs").then(
  fs.readdir("./", function (err, list) {
    console.log(err);
    console.log("");
    console.log(list.join(", "));
  })
);

Expected behavior
Expected output:

null

index.js, package-lock.json, package.json

The expected output occurs if I use old common JS approach: let fs = require("fs");. In the case of modules nothing outputs to the terminal, not even error messaging.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS] Windows 10 on a desktop
  • Browser [e.g. chrome, safari] Chrome
  • Version [e.g. 22] 90

Additional context
The expected Node error messaging does display if not appeasing Node's requirements for supporting modules, which are either rename the file from extension .js to .mjs or adding the "types": "module" to the package.json file.

BUG: can't run fastify webserver [Error: EBADF: bad file descriptor, write]


name: Bug report
about: Create a report to help us improve
title: 'can't run fastify webserver [Error: EBADF: bad file descriptor, write] '
labels: ''
assignees: ''


Describe the bug
can't run the fastify webserver

[nodemon] restarting due to changes...
[nodemon] starting `node server.js`
[Error: EBADF: bad file descriptor, write] {
  syscall: 'write',
  errno: -9,
  code: 'EBADF'
}
[nodemon] app crashed - waiting for file changes before starting...

Link to the blitz that caused the error
https://stackblitz.com/edit/http-server-r8kujv

To Reproduce
Steps to reproduce the behavior:

  1. start with the http server demo
  2. npm install fastify
  3. copy/paste quickstart example from https://fastify.io
  4. do local save

Expected behavior
nodemon will start the script, fastify webserver should start at port 3000

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.218
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (X11; CrOS x86_64 13816.82.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.218 Safari/537.36
performance.memory = {
totalJSHeapSize: 53915145,
usedJSHeapSize: 52589837,
jsHeapSizeLimit: 2020868096
}

Additional context
I know fastify is rather low level node.js, but if this works almost anything will work ;-)

BUG: TypeError: Class extends value undefined is not a constructor or null


name: Bug report
about: Create a report to help us improve
title: 'TypeError: Class extends value undefined is not a constructor or null'
labels: ''
assignees: ''


Describe the bug

npx next dev triggers error after installing aws-amplify and @aws-amplify/ui-react:

TypeError: Class extends value undefined is not a constructor or null
    at Object.618 (/projects/nextjs-fbxtsa/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:161)
    at __nccwpck_require__ (/projects/nextjs-fbxtsa/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11796)
    at Object.270 (/projects/nextjs-fbxtsa/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:474)
    at __nccwpck_require__ (/projects/nextjs-fbxtsa/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11796)
    at Object.327 (/projects/nextjs-fbxtsa/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:321)
    at __nccwpck_require__ (/projects/nextjs-fbxtsa/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11796)
    at Object.845 (/projects/nextjs-fbxtsa/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:3794)
    at __nccwpck_require__ (/projects/nextjs-fbxtsa/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11796)
    at eval (/projects/nextjs-fbxtsa/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11924)
    at Object.eval (/projects/nextjs-fbxtsa/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11950)
    at Object.function (https://nextjs-fbxtsa.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:19819)
    at Module._compile (https://nextjs-fbxtsa.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187549)
    at Object.Module._extensions..js (https://nextjs-fbxtsa.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187908)
    at Module.load (https://nextjs-fbxtsa.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:185988)
    at Function.Module._load (https://nextjs-fbxtsa.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:183564)
    at Module.require (https://nextjs-fbxtsa.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:186304)

error Command failed with exit code 1

Link to the blitz that caused the error
https://stackblitz.com/edit/nextjs-fbxtsa?file=pages%2Findex.js

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://stackblitz.com/fork/nextjs
  2. Ctrl-C the server
  3. npm i aws-amplify @aws-amplify/ui-react
  4. npm install && npx next dev

Expected behavior

I didn't change any of the code, only installed dependencies, so I expected npx next dev to work at least.

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.93
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
performance.memory = {
totalJSHeapSize: 97503413,
usedJSHeapSize: 74534329,
jsHeapSizeLimit: 4294705152
}

Broken link on blog

Describe the bug
A broken link in the interweb between the latest blog post and this repository.

To Reproduce
Steps to reproduce the behavior:

  1. open browser
  2. navigate to this blog post
  3. smile
  4. scroll down to the bottom
  5. click on 'core WebContainer WG repo' link

Expected behavior
I expected to be transported from the blog page to the repo page

Screenshots
image

Additional context
the exact broken link is https://github.com/stackblitz/webcontainer-core/blob/main/Add_support_for_a_framework.md

Container is not booting BUG:


name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''


Describe the bug
A clear and concise description of what the bug is.

Link to the blitz that caused the error
https://stackblitz.com/edit/node-bxeuqr

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.212
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
performance.memory = {
totalJSHeapSize: 65061278,
usedJSHeapSize: 58711870,
jsHeapSizeLimit: 2172649472
}

Additional context
Add any other context about the problem here.

BUG: Executing any binary leads to `SyntaxError: Invalid or unexpected token`

Describe the bug
When you execute a binary (e.g. via execa.sync) the process crashes and a SyntaxError is output to stderr.

❯ node repro.js 
Error: Command failed with exit code 1: /projects/node-psqsqe/node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x
SyntaxError: Invalid or unexpected token
    at __global_eval__ (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:8:15954)
    at _0x18a892 (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:21075)
    at _0x372288.runInThisContext (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:20268)
    at _0x2e8059 (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:19362)
    at wrapSafe (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:186554)
    at Module._compile (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187186)
    at Object.Module._extensions..js (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187908)
    at Module.load (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:185988)
    at Function.Module._load (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:183564)
    at Function.executeUserEntryPoint [as runMain] (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:794701)
    at makeError (/projects/node-psqsqe/node_modules/execa/lib/error.js:59:11)
    at Function.module.exports.sync (/projects/node-psqsqe/node_modules/execa/index.js:186:17)
    at Object.eval (/projects/node-psqsqe/repro.js:21:26)
    at Object.function (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:19819)
    at Module._compile (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187549)
    at Object.Module._extensions..js (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187908)
    at Module.load (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:185988)
    at Function.Module._load (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:183564)
    at Function.executeUserEntryPoint [as runMain] (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:794701)
    at Object.a0_0x310c (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:1395336) {
  shortMessage: 'Command failed with exit code 1: /projects/node-psqsqe/node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x',
  command: '/projects/node-psqsqe/node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: 'SyntaxError: Invalid or unexpected token\n' +
    '    at __global_eval__ (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:8:15954)\n' +
    '    at _0x18a892 (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:21075)\n' +
    '    at _0x372288.runInThisContext (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:20268)\n' +
    '    at _0x2e8059 (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:19362)\n' +
    '    at wrapSafe (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:186554)\n' +
    '    at Module._compile (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187186)\n' +
    '    at Object.Module._extensions..js (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187908)\n' +
    '    at Module.load (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:185988)\n' +
    '    at Function.Module._load (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:183564)\n' +
    '    at Function.executeUserEntryPoint [as runMain] (https://node-psqsqe.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:794701)',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

Looks to me as the binary never really is executed but something fails earlier.

Link to the blitz that caused the error
https://stackblitz.com/edit/node-ktsmgm?file=repro.js

To Reproduce
Steps to reproduce the behavior:

  1. Go to the blitz
  2. Run node repro.js
  3. Observe the error

You can observe similar behavior by running e.g. npx prisma -v.

Expected behavior
The binary can be executed and e.g. data is returned.

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.93
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
performance.memory = {
totalJSHeapSize: 87445835,
usedJSHeapSize: 83184883,
jsHeapSizeLimit: 4294705152
}

Additional context
The blitz uses prisma to have a binary to execute, repro.js then is a minimal version/variant of the code the Prisma CLI itself would also run. If for some reason no dependencies are installed, npm install is not enough, also run npx prisma, npx prisma -v and npx prisma format once to trigger the on demand download of said binary.

BUG: Installing node modules as global via npm fails


name: Bug report
about: jsh syntax error when installing npm package as global
title: ''
labels: ''
assignees: ''


Describe the bug
I'm unable to install any node modules as global via npm. I keep getting syntax error
Unknown Syntax Error: Command not found; did you mean one of:

Link to the blitz that caused the error
https://stackblitz.com/edit/node-vutu3g?file=README.md

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.212
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
performance.memory = {
totalJSHeapSize: 136726149,
usedJSHeapSize: 130206821,
jsHeapSizeLimit: 4294705152
}

Additional context
Add any other context about the problem here.

BUG: Gatsby

v2 of StackBlitz looks amazing!

The only thing, I can't get Gatsby to work.

Describe the bug

  1. I run: npm run start -or- yarn start
  2. and get this (after a view seconds):
Error: listen EADDRINUSE: address already in use ::
...
UNHANDLED REJECTION Cannot read property 'updateTimeout' of undefined

Link to the blitz that caused the error
gatsby-starter

To Reproduce
Steps to reproduce the behavior:

  1. Go to gatsby-starter
  2. Scroll down to the CLI
  3. Enter: npm run start
  4. See error (after a view seconds)

Expected behavior
See the index page of the app -or- get it up and running, basically.

Screenshot
Screenshot 2021-05-21 at 08 47 36

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.212
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
performance.memory = {
totalJSHeapSize: 71299714,
usedJSHeapSize: 66683866,
jsHeapSizeLimit: 4294705152
}

Additional context
I really hope we can sort this out and even better, get a default Gatsby starter provided by your amazing Team! (You can use mine if you wish)

Happy day!

Tobias Høegh

BUG: crypto.createHmac not working

Describe the bug
Node REPL failed when running crypto.createHmac

Link to the blitz that caused the error
https://stackblitz.com/edit/http-server-fnwea1?file=server.js

To Reproduce
Steps to reproduce the behavior:
Open node REPL, enter require('crypto').createHmac('sha256', 'abcdefg').update('I love cupcakes').digest('hex'); and I got TypeError.

Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
    at new e.exports (https://http-server-fnwea1.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:1179499)
    at new Hmac (https://http-server-fnwea1.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:924216)
    at Object.createHmac (https://http-server-fnwea1.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:612717)
    at eval (REPL1:1:19)
    at __global_eval__ (https://http-server-fnwea1.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:8:15949)
    at _0x18a892 (https://http-server-fnwea1.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:21075)
    at Script.runInThisContext (https://http-server-fnwea1.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:20268)
    at Script.runInThisContext (https://http-server-fnwea1.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:458038)
    at REPLServer.p (https://http-server-fnwea1.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:1092122)
    at bound (https://http-server-fnwea1.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:1322974)

Expected behavior
Correct hash should be printed.

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.212
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36 Edg/90.0.818.62
performance.memory = {
totalJSHeapSize: 82262584,
usedJSHeapSize: 73815152,
jsHeapSizeLimit: 4294705152
}

BUG: importing github repos without master branch fails to load project files


name: Bug report
about: Create a report to help us improve
title: importing github repos without master branch fails to load project files
labels: ''
assignees: ''


To Reproduce
Steps to reproduce the behavior:

  1. Go to "Connect repository"
  2. Click on "import an existing repository"
  3. enter a repo without master, I used https://github.com/graphile/starter
  4. error loading "refs/heads/master"
  5. picking a new repo from the dropdown appears to have no effect

Expected behavior
project files load as expected

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.212
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
performance.memory = {
totalJSHeapSize: 54076718,
usedJSHeapSize: 51103002,
jsHeapSizeLimit: 4294705152
}

BUG: Can't switch github branch away from master


name: Bug report
about: Create a report to help us improve
title: 'Cant switch github branch away from master'
labels: ''
assignees: ''

Describe the bug
If a github repository doesn't have a master branch you're presented with several errors and can't switch to a different branch.

To Reproduce
Steps to reproduce the behavior:

  1. Connect to a repository with no master branch
  2. Try to switch to an active branch
  3. See errors

Expected behavior
I would expect to be able to switch branches

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.212
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
performance.memory = {
totalJSHeapSize: 70065194,
usedJSHeapSize: 63652034,
jsHeapSizeLimit: 4294705152
}

Additional context
Errors in console are:

GitInit Could not resolve reference "refs/heads/master".
Uncaught (in promise) TypeError: Cannot convert undefined or null to object

BUG: Failed to Fetch modules / next can't find react.


name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug'
assignees: ''


Describe the bug
A clear and concise description of what the bug is.

Link to the blitz that caused the error
https://stackblitz.com/github/mc-build/mcbuild.dev?file=package.json

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://stackblitz.com/github/mc-build/mcbuild.dev?file=package.json
  2. See error

Expected behavior
react and react-dom are not found by next although they are in the package.json file under dependencies.

  • this may be due to an error with module resolution HttpError: Failed to fetch dependencies

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.212
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
performance.memory = {
totalJSHeapSize: 59938551,
usedJSHeapSize: 56875467,
jsHeapSizeLimit: 4294705152
}

Additional context

terminal log

/projects/nbwiorvzn.github
❯ npm install && npx next dev
warn preInstall No description field
warn preInstall No repository field
warn preInstall No license field
┌ [1/3] 🔍  Resolving dependencies
└ Completed in 21.922s
┌ [2/3] 🚚  Fetching dependencies
└ 𐄂 Failed
HttpError: Failed to fetch dependencies

error Command failed with exit code 1
success Install finished in 7.539s

The module 'react' was not found. Next.js requires that you include it in 'dependencies' of your 'package.json'. To add it, run 'npm install react'
The module 'react-dom' was not found. Next.js requires that you include it in 'dependencies' of your 'package.json'. To add it, run 'npm install react-dom'
Error: Cannot find module 'react'
Require stack:
- /.turbo/npx/DT8K2j/node_modules/next/dist/bin/next
    at Function.Module._resolveFilename (https://nbwiorvzn--github.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:185516)
    at Function.Module._load (https://nbwiorvzn--github.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:183130)
    at Module.require (https://nbwiorvzn--github.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:186304)
    at i (https://nbwiorvzn--github.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:484674)
    at _0x1e5cfd (https://nbwiorvzn--github.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:19724)
    at Object.eval (/.turbo/npx/DT8K2j/node_modules/next/dist/bin/next:25:13)
    at Object.function (https://nbwiorvzn--github.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:19819)
    at Module._compile (https://nbwiorvzn--github.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187549)
    at Object.Module._extensions..js (https://nbwiorvzn--github.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187908)
    at Module.load (https://nbwiorvzn--github.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:185988) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/.turbo/npx/DT8K2j/node_modules/next/dist/bin/next' ]
}

error Command failed with exit code 1

/projects/nbwiorvzn.github 39s
❯ 

/projects/nbwiorvzn.github
❯ 

BUG: Opening local folder doesn't include .svg files


name: Bug report
about: Create a report to help us improve


Describe the bug
When I open a local folder from my Mac, it doesn't include the .svg files.

Link to the blitz that caused the error
https://stackblitz.com/edit/node-uwf9jt?file=components%2Fsocial-icons%2Findex.js

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Screenshots
image

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.212
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
performance.memory = {
totalJSHeapSize: 142216057,
usedJSHeapSize: 121063469,
jsHeapSizeLimit: 2172649472
}

Forking a project does not update the URL in the preview panel

Describe the bug

When forking a project, the URL in the preview panel isn't updated to reflect the URL of the new fork. Therefore, modifications to the project are not reflected in the preview panel.

The workaround is to refresh the entire screen.

Link to the blitz that caused the error

https://stackblitz.com/edit/nextjs-bw83rd?file=pages%2Findex.js

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://stackblitz.com/edit/nextjs-bw83rd?file=pages%2Findex.js
  2. Click on the fork button
  3. Notice that the project name changes, but the URL in the preview panel doesn't
  4. Make changes to the content in index.js
  5. Notice that the changes made to index.js aren't reflected in the preview

Expected behavior

The preview panel URL should be updated to reflect the new forked project and any subsequent changes to index.js should be applied to the preview.

Screenshots

N/A

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Chrome
  • Version: 90.0.4430.212

Additional context

N/A

BUG: Doesn't work on Brave (chromium based)


name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''


Describe the bug
It seems it cannot open a port (so the final step hangs)

Link to the blitz that caused the error
https://stackblitz.com/edit/nextjs-rbr6hp

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.93
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
performance.memory = {
totalJSHeapSize: 63342813,
usedJSHeapSize: 55091709,
jsHeapSizeLimit: 4294705152
}

Additional context
Add any other context about the problem here.

Framework support for SvelteKit

Describe the solution you'd like

https://stackblitz.com/edit/sveltekit-template

This is a clone of the current SvelteKit template app

Turbo failed to install @sveltejs/kit@next however using npm "worked" 🤷

The webcontainer fails to start, I believe it is something to do with the package resolution. SvelteKit is built with pnpm if that matters.

Before I new to use Turbo I had installed the deps with npm and was unable to run npm run dev as there was an issue resolving the deps. I will try and recreate and pase the error here.

Give a link to a github repo containing an example of the framework

I am the creator of adapter to configure SvelteKit apps for SSR hosting on Firebase - svelte-adapter-firebase

Here is the same template as above that I use for CI testing of the adapter - https://github.com/jthegedus/svelte-adapter-firebase/tree/main/examples/functions_single_site

I am keen to have a complete solution for Firebase web app development.

Additional context

#8 is almost certainly related because:

  • SvelteKit is built on top of Vite.
  • SvelteKit adapters use esbuild duing the build step.

Web Crypto API not detected correctly?

Describe the bug
Attempting to use zlib's brotli or gzip compression seems to generate an error like:
Cannot read property constants of undefined.

Looking into the stack, this seems to happen because initialization of the zlib module fails due to crypto.randomBytes() being unavailable. Looking into why that would be the case, it seems like the detection for the Web Crypto API is attempting to access self.crypto:

<snip> "object"==typeof self)self.crypto&&self.crypto.getRandomValues ? <snip>

... unfortunately, self has been set to undefined (not sure why). Paused at that callsite however, global.crypto does exist.

https://stackblitz.com/edit/node-zewtyo?file=package.json

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://stackblitz.com/edit/node-zewtyo?file=package.json

  2. Run npm start (or directly, node ./node_modules/.bin/wmr)

  3. See error:

    Screen Shot 2021-05-21 at 12 51 16 PM

Expected behavior
global.crypto is used, there is no error, and importing zlib returns zlib.

Screenshots
Screen Shot 2021-05-21 at 12 49 42 PM

Desktop (please complete the following information):

  • OS: MacOS 10.15.7
  • Browser: Chrome 91.0.4472.57

BUG: npx create-xxx created files are always not saved into the project


name: Bug report
about: npx create-xxx created files are always not saved into the project
title: ''
labels: ''
assignees: ''


Describe the bug
npx create-xxx created files are always not saved into the project

Link to the blitz that caused the error
All current node projects wont work

like https://stackblitz.com/edit/ef-playground

To Reproduce
Steps to reproduce the behavior:

  1. remove all files in the project

cd /projects
npx create-ef-app ef-playground
(all the way enter)
  1. save the project
  2. refresh the page or click download then check the content
  3. you will find nothing

Expected behavior
All created files should appear in the file lists and will be saved.

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.212
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
performance.memory = {
totalJSHeapSize: 102110997,
usedJSHeapSize: 76362701,
jsHeapSizeLimit: 4294705152
}

Additional context
Add any other context about the problem here.

BUG: project with `"type": "module"` not working correctly


name: Bug report
about: Create a report to help us improve
title: 'project with "type": "module" not working'
labels: 'esm'
assignees: ''


Describe the bug
If you add the entry "type": "module" on package.json break the normal behavior

Link to the blitz that caused the error
https://stackblitz.com/edit/node-wyhu7f?file=package.json

To Reproduce
Steps to reproduce the behavior:

  1. run node index.js

Expected behavior
A message is this display with : Hello Node.js v14.16.0!

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Screenshots
Capture d’écran 2021-05-21 à 09 15 11

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.212
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
performance.memory = {
totalJSHeapSize: 63981338,
usedJSHeapSize: 59038818,
jsHeapSizeLimit: 4294705152
}

Additional context
Add any other context about the problem here.

BUG: type popups on .tsx files imported from github repo


name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''


Describe the bug
Typescript types highlighting works on the *.ts files, but the *.tsx files it does not. I thought it might be due to use of linaria, but even non-linaria .tsx files there is no highlighting.

Link to the blitz that caused the error
https://stackblitz.com/edit/github-8auner?file=src%2FBoundary.tsx

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://stackblitz.com/edit/github-8auner?file=src%2FBoundary.tsx
  2. Hover over 'children' variable

Expected behavior
Hover context popup with its type

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.212
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
performance.memory = {
totalJSHeapSize: 159765627,
usedJSHeapSize: 156720619,
jsHeapSizeLimit: 4294705152
}

Additional context
Add any other context about the problem here.

BUG: getFileName() on Error stack returns undefined

Describe the bug

new Error().stack[0].getFileName() does not return the file name but undefined. It should return the location of the file in the stack trace.

This is a common strategy to detect a caller file location. It is used in get-caller-file package, which has 25 million downloads per week accordingly to NPM. As it only requires a few lines of code it is very likely that the same technique is used even more.

It requires overloading of Error.prepareStackTrace. The implementation in get-caller-file package could be found here: https://github.com/stefanpenner/get-caller-file/blob/master/index.ts

I noticed this when trying to run ember-cli, which relies on get-caller-file.

Link to the blitz that caused the error

https://stackblitz.com/edit/node-ynwi5b?file=index.js

The following code returns undefined in Stackblitz but a file path in regular node installation.

Error.prepareStackTrace = (_, stack) => stack;
const error = Error('myError');
console.log(error.stack[0].getFileName());

You can execute by running node index.js in the blitz linked above.

As an alternative reproduction you could install get-caller-file and follow the usage example given in its documentation. It will demonstrate the same difference between regular node installation and stackblitz.

Expected behavior

It should return a file path in Stackblitz as well.

Desktop (please complete the following information):

Browser name = Chrome
Full version = 90.0.4430.212
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
performance.memory = {
totalJSHeapSize: 70345978,
usedJSHeapSize: 67259162,
jsHeapSizeLimit: 4294705152
}

Additional context

node-bindings package was facing the same issue: TooTallNate/node-bindings#29 It was fixed by this commit: TooTallNate/node-bindings@d0bd6f8

`dgram.createSocket` Fails to execute (missing function)

Describe the bug
Node's built-in way of creating a UDP server fails. While importing dgram is allowed, calling dgram.createSocket('udp4'); throws a TypeError. The stack trace is provided below.

Link to the blitz that caused the error
https://stackblitz.com/edit/node-unqbfc?file=index.js

To Reproduce
Steps to reproduce the behavior:

  1. Go to the linked
  2. Run node index.js in the terminal
  3. See error

Expected behavior
The UDP server is created, allowing me to send data over the socket.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS] macOS
  • Browser [e.g. chrome, safari] Chrome
  • Version [e.g. 22] 90

Additional Context

Exception stacktrace

TypeError: s.getAsyncId is not a function
    at new Socket (https://node-unqbfc.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:1309655)
    at Object.createSocket (https://node-unqbfc.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:1320280)
    at Object.eval (/projects/node-unqbfc/index.js:5:25)
    at Object.function (https://node-unqbfc.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:19819)
    at Module._compile (https://node-unqbfc.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187549)
    at Object.Module._extensions..js (https://node-unqbfc.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:187908)
    at Module.load (https://node-unqbfc.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:185988)
    at Function.Module._load (https://node-unqbfc.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:183564)
    at Function.executeUserEntryPoint [as runMain] (https://node-unqbfc.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:794701)
    at Object.a0_0x310c (https://node-unqbfc.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:1395336)

Third-Party Service Worker Registration and Brave

Describe the bug
For a user running Brave under normal settings, the service worker registration for stackblitz.io fails, as it is a third party domain. This failure prevents the localhost server from being stood up for the user's blitz. To remedy the issue, a user can modify their shields (via the lion icon to the right of the address bar) in Brave to permit third-party cookies (this setting also controls third-party service workers).

Link to the blitz that caused the error

To Reproduce
Steps to reproduce the behavior:

  1. In Brave, visit https://stackblitz.com/edit/web-platform-kaxdum

Expected behavior

The "localhost" connection is established, and the content is shown.

Screenshots

service-workers-registration

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Brave
  • Version: 1.24.85

Additional context

If you catch the registration failure, you can inform the user that their security settings may have prevented the feature from working. For Brave users (there are over 30 million monthly active users at the time of this writing), you can can inform them that relaxing the shield settings for cookies (and other third-party storage) will resolve the issue. This is what I did in the GIF above. Brave can be detected via its navigator.brave.isBrave function (which returns a promise).

Bug: Web Container fails to load with certain project structure

Describe the bug
A WebContainer gets stuck on the Booting WebContainer step and devtools shows the error Cannot set property 'NodeFS.gcomp' of undefined where NodeFS.gcomp is the name of both a folder and a file within a folder for my project:
image

Error screenshot:
image

Full error text:

click to show full console log
[Violation] Forced reflow while executing JavaScript took 42ms
client-c18b3511dd425ab7c939b.js:2 Uncaught (in promise) TypeError: Cannot set property 'NodeFS.gcomp' of undefined
    at client-c18b3511dd425ab7c939b.js:2
    at Array.reduce ()
    at client-c18b3511dd425ab7c939b.js:2
    at Array.forEach ()
    at C (client-c18b3511dd425ab7c939b.js:2)
    at client-c18b3511dd425ab7c939b.js:2
    at u (client-c18b3511dd425ab7c939b.js:2)
    at Generator._invoke (client-c18b3511dd425ab7c939b.js:2)
    at Generator.E.forEach.e. [as next] (client-c18b3511dd425ab7c939b.js:2)
    at client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
C @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
u @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
E.forEach.e. @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
nrWrapper @ node-webvi-express?file=Builds:8
r @ node-webvi-express?file=Builds:8
_ @ client-c18b3511dd425ab7c939b.js:2
x @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
Da @ client-c18b3511dd425ab7c939b.js:2
As @ client-c18b3511dd425ab7c939b.js:2
t.unstable_runWithPriority @ client-c18b3511dd425ab7c939b.js:2
vo @ client-c18b3511dd425ab7c939b.js:2
Ds @ client-c18b3511dd425ab7c939b.js:2
_s @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
t.unstable_runWithPriority @ client-c18b3511dd425ab7c939b.js:2
vo @ client-c18b3511dd425ab7c939b.js:2
Eo @ client-c18b3511dd425ab7c939b.js:2
wo @ client-c18b3511dd425ab7c939b.js:2
Es @ client-c18b3511dd425ab7c939b.js:2
notify @ client-c18b3511dd425ab7c939b.js:2
t.notifyNestedSubs @ client-c18b3511dd425ab7c939b.js:2
t.handleChangeWrapper @ client-c18b3511dd425ab7c939b.js:2
y @ client-c18b3511dd425ab7c939b.js:2
dispatch @ VM655:3856
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
dispatch @ VM655:14608
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
nrWrapper @ node-webvi-express?file=Builds:8
Promise.then (async)
(anonymous) @ node-webvi-express?file=Builds:8
i @ client-c18b3511dd425ab7c939b.js:2
Jo @ client-c18b3511dd425ab7c939b.js:2
da @ client-c18b3511dd425ab7c939b.js:2
Ns @ client-c18b3511dd425ab7c939b.js:2
js @ client-c18b3511dd425ab7c939b.js:2
Os @ client-c18b3511dd425ab7c939b.js:2
ys @ client-c18b3511dd425ab7c939b.js:2
Zs @ client-c18b3511dd425ab7c939b.js:2
Js @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
xs @ client-c18b3511dd425ab7c939b.js:2
ac @ client-c18b3511dd425ab7c939b.js:2
render @ client-c18b3511dd425ab7c939b.js:2
m @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
f @ client-c18b3511dd425ab7c939b.js:2
g @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
nrWrapper @ node-webvi-express?file=Builds:8
Show 8 more frames
registry.worker.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6 [@blitz/registry] [INFO] Successfully initialized
blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:8 [Deprecation] SharedArrayBuffer will require cross-origin isolation as of M91, around May 2021. See https://developer.chrome.com/blog/enabling-shared-array-buffer/ for more details.
_0x4c8301 @ blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:8
initFileSystem @ blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11
init @ blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11
_0x293e01 @ blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11
blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11 [Deprecation] SharedArrayBuffer will require cross-origin isolation as of M91, around May 2021. See https://developer.chrome.com/blog/enabling-shared-array-buffer/ for more details.
_0x293e01 @ blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11
node-webvi-express?file=Builds:8 [Violation] 'setTimeout' handler took 149ms
[Violation] Forced reflow while executing JavaScript took 31ms
blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11 [Deprecation] SharedArrayBuffer will require cross-origin isolation as of M91, around May 2021. See https://developer.chrome.com/blog/enabling-shared-array-buffer/ for more details.
_0x293e01 @ blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11
client-c18b3511dd425ab7c939b.js:2 Uncaught (in promise) TypeError: Cannot read property 'updateOptions' of undefined
    at client-c18b3511dd425ab7c939b.js:2
    at u (client-c18b3511dd425ab7c939b.js:2)
    at Generator._invoke (client-c18b3511dd425ab7c939b.js:2)
    at Generator.E.forEach.e. [as next] (client-c18b3511dd425ab7c939b.js:2)
    at a (client-c18b3511dd425ab7c939b.js:2)
    at nrWrapper (node-webvi-express?file=Builds:8)
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
u @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
E.forEach.e. @ client-c18b3511dd425ab7c939b.js:2
a @ client-c18b3511dd425ab7c939b.js:2
nrWrapper @ node-webvi-express?file=Builds:8
Promise.then (async)
(anonymous) @ node-webvi-express?file=Builds:8
c @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
nrWrapper @ node-webvi-express?file=Builds:8
r @ node-webvi-express?file=Builds:8
_t @ client-c18b3511dd425ab7c939b.js:2
value @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
nrWrapper @ node-webvi-express?file=Builds:8
setTimeout (async)
nrWrapper @ node-webvi-express?file=Builds:8
value @ client-c18b3511dd425ab7c939b.js:2
As @ client-c18b3511dd425ab7c939b.js:2
t.unstable_runWithPriority @ client-c18b3511dd425ab7c939b.js:2
vo @ client-c18b3511dd425ab7c939b.js:2
Ds @ client-c18b3511dd425ab7c939b.js:2
_s @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
t.unstable_runWithPriority @ client-c18b3511dd425ab7c939b.js:2
vo @ client-c18b3511dd425ab7c939b.js:2
Eo @ client-c18b3511dd425ab7c939b.js:2
wo @ client-c18b3511dd425ab7c939b.js:2
Es @ client-c18b3511dd425ab7c939b.js:2
notify @ client-c18b3511dd425ab7c939b.js:2
t.notifyNestedSubs @ client-c18b3511dd425ab7c939b.js:2
t.handleChangeWrapper @ client-c18b3511dd425ab7c939b.js:2
y @ client-c18b3511dd425ab7c939b.js:2
dispatch @ VM655:3856
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
dispatch @ VM655:14608
z @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
u @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
E.forEach.e. @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
nrWrapper @ node-webvi-express?file=Builds:8
r @ node-webvi-express?file=Builds:8
fa @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ client-c18b3511dd425ab7c939b.js:2
r._invokeFactory @ loader.js:7
r.complete @ loader.js:7
r._onModuleComplete @ loader.js:8
r._onModuleComplete @ loader.js:8
r._onModuleComplete @ loader.js:8
r._onModuleComplete @ loader.js:8
r._onModuleComplete @ loader.js:8
r._onModuleComplete @ loader.js:8
r._onModuleComplete @ loader.js:8
r._onModuleComplete @ loader.js:8
r._onModuleComplete @ loader.js:8
r._onModuleComplete @ loader.js:8
r._onModuleComplete @ loader.js:8
r._onModuleComplete @ loader.js:8
r._resolve @ loader.js:8
r.defineModule @ loader.js:7
o @ loader.js:7
r @ editor.main.js:6
r._invokeFactory @ loader.js:7
r.complete @ loader.js:7
r._onModuleComplete @ loader.js:8
r._onModuleComplete @ loader.js:8
r._resolve @ loader.js:8
r.defineModule @ loader.js:7
_ @ loader.js:8
window.define @ client-c18b3511dd425ab7c939b.js:2
(anonymous) @ editor.main.nls.js:6
Show 44 more frames
iframe.7286dbe8d47d3…048fb59b05f2.html:1 Uncaught (in promise) {message: "ENOENT: no such file or directory", code: "ENOENT", errno: -2, path: undefined, syscall: undefined, …}
Promise.then (async)
apply @ blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11
run @ blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11
async function (async)
run @ blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11
registerListenersAndRunOnInstance @ blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11
run @ blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11
_0x293e01 @ blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11
blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11 [Deprecation] SharedArrayBuffer will require cross-origin isolation as of M91, around May 2021. See https://developer.chrome.com/blog/enabling-shared-array-buffer/ for more details.

Link to the blitz that caused the error
https://stackblitz.com/edit/node-webvi-express

To Reproduce
Steps to reproduce the behavior:

  1. Open the blitz

  2. Note: the blitz gets stuck on Booting WebContainer

    image

Expected behavior
Blitz continues to load and I eventually can run the npm start command

Screenshots
See above.

Desktop (please complete the following information):

  • OS: Win 10 20H2 (OS Build 19042.985)
  • Browser Chrome
  • Version 90.0.4430.212 (Official Build) (64-bit)

Additional context
My guess is that something is getting tripped up by the file output of our tool which places files inside folders of the same name, ie a folder named NodeFS.gcomp (yes the folder name has a period) containing a file named NodeFS.gcomp.

If I manually remove folders with that naming convention the WebContainer is able to fully load: https://stackblitz.com/edit/node-webvi-express-names-clean

BUG: Extraneous positional argument when running `npm init foo`

Congrats on the launch! Very exciting.

Describe the bug
npm init foo downloads the create-foo package and runs the "bin" specified in its package.json. It's commonly used to scaffold new projects.

It looks like turbo init behaves similarly to npm init, but turbo init foo (and by extension npm init foo) fails:

image

Link to the blitz that caused the error
https://stackblitz.com/edit/node-qcu4bd

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://stackblitz.com/edit/node-qcu4bd
  2. Click into the terminal
  3. Type npm init foo or turbo init foo

Expected behavior
The same behaviour as npm init foo

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.93
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
performance.memory = {
totalJSHeapSize: 55442824,
usedJSHeapSize: 51747536,
jsHeapSizeLimit: 4294705152
}

Additional context
Add any other context about the problem here.

Bug: npm run script is not able to run files correctly

Describe the bug
Running npm scripts that use paths with certain characters seems to fail.

Link to the blitz that caused the error
https://stackblitz.com/edit/node-npm-run-script

To Reproduce
Steps to reproduce the behavior:

  1. Open the blitz and run npm start
  2. Note: The command results in an error
  3. Run the command printed by npm start manually in the console by copy and pasting
  4. Note: The command when run from the terminal directly succeeds

Expected behavior
Using npm start is able to run the script correctly.

Screenshots
image

Desktop (please complete the following information):

  • OS: Win 10 20H2 (OS Build 19042.985)
  • Browser Chrome
  • Version 90.0.4430.212 (Official Build) (64-bit)

Additional context
N/A

v8.getHeapSpaceStatistics crashes REPL

Describe the bug

Node REPL crashes on require("v8").getHeapSpaceStatistics().

To Reproduce

Open node REPL, enter require("v8").getHeapSpaceStatistics(). See crash:

Uncaught TypeError: j is not a function
    at Object.getHeapSpaceStatistics (https://node-6taf5d.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:625925)
    at eval (REPL10:1:15)
    at __global_eval__ (https://node-6taf5d.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:8:15949)
    at _0x18a892 (https://node-6taf5d.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:21075)
    at Script.runInThisContext (https://node-6taf5d.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:11:20268)
    at Script.runInThisContext (https://node-6taf5d.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:458038)
    at REPLServer.p (https://node-6taf5d.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:1092122)
    at bound (https://node-6taf5d.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:1322974)
    at REPLServer.runBound [as eval] (https://node-6taf5d.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:1324533)
    at REPLServer.<anonymous> (https://node-6taf5d.jw.staticblitz.com/blitz.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6:1098633)

Expected behavior

I get heap statistics.

Desktop:

Google Chrome 90.0.4430.212 (Official Build) (64-bit)
Revision e3cd97fc771b893b7fd1879196d1215b622c2bed-refs/branch-heads/4430@{#1429}
OS Linux
JavaScript V8 9.0.257.29

Work like github codespaces

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
No
Describe the solution you'd like
A clear and concise description of what you want to happen.
Allow you to code in vscode, via the stackblitz platform. Like github codespaces. This'd be the ultimate dev experience! 🚀
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
N/A
Additional context
Add any other context or screenshots about the feature request here.

BUG(?): imported TypeScript libs don't seem inferred

Describe the bug
imported TypeScript libs don't seem inferred

Link to the blitz that caused the error
https://stackblitz.com/github/trpc/trpc/tree/main/examples/next-prisma-starter?file=pages%2Fapi%2Ftrpc%2Fposts.ts

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://stackblitz.com/github/trpc/trpc/tree/main/examples/next-prisma-starter?file=pages%2Fapi%2Ftrpc%2Fposts.ts
  2. Hover over postsRouter
  3. See type def

Expected behavior

Should have typescript definition

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Screenshots
If applicable, add screenshots to help explain your problem.

StackBlitz screenshot

infers type any

Screenshot 2021-05-21 at 17 01 34

CodeSandbox Screenshot

infers correct type

https://codesandbox.io/s/github/trpc/trpc/tree/main/examples/next-prisma-starter?file=/pages/api/trpc/posts.ts
Screenshot 2021-05-21 at 17 01 42

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.212
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
performance.memory = {
totalJSHeapSize: 138985846,
usedJSHeapSize: 132344770,
jsHeapSizeLimit: 4294705152
}

Additional context
Add any other context about the problem here.

BUG: Adding `sass` as dependency only works after a page refresh

Describe the bug
@trezy tried WebContainer live on Twitch and ran into the issue where next dev fails to build after installing sass. After a page refresh it works.

Link to the blitz that caused the error

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Next.js project
  2. Stop the build process and run turbo add sass
  3. Start the server with turbo dev
/projects/nextjs-cp1rsm
❯ turbo dev
$ next dev
TypeError: Class extends value undefined is not a constructor or null
    at Object.618 (/projects/nextjs-cp1rsm/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:161)
    at __nccwpck_require__ (/projects/nextjs-cp1rsm/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11796)
    at Object.270 (/projects/nextjs-cp1rsm/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:474)
    at __nccwpck_require__ (/projects/nextjs-cp1rsm/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11796)
    at Object.327 (/projects/nextjs-cp1rsm/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:321)
    at __nccwpck_require__ (/projects/nextjs-cp1rsm/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11796)
    at Object.845 (/projects/nextjs-cp1rsm/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:3794)
    at __nccwpck_require__ (/projects/nextjs-cp1rsm/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11796)
    at eval (/projects/nextjs-cp1rsm/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11924)
    at Object.eval (/projects/nextjs-cp1rsm/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11950)
  1. Reload the page and now turbo dev works 🎉

Expected behavior
After running turbo add sass, the turbo dev command should just work.

Screenshots
/

Desktop (please complete the following information):

  • OS: macOS 11.3.1
  • Browser Chrome
  • Version 91

Additional context
/

BUG: `*` not working in jsh

Describe the bug
* not working in jsh

Link to the blitz that caused the error

To Reproduce
Steps to reproduce the behavior:

rm -r *
# rm: cannot remove '*': No such file or directory

mv aaa/* bbb
# mv: cannot stat 'aaa/*': No such file or directory

Expected behavior
Do what it should do

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

BUG: GraphQL starter returns error EOF


name: Bug report
about: Create a report to help us improve
title: 'GraphQL starter returns error EOF'
labels: 'graphql'
assignees: ''


Describe the bug
The GraphQL starter seems to have a minor misconfiguration issue.

Link to the blitz that caused the error
https://stackblitz.com/edit/graphql-s4wnmh

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'stackblitz.com'
  2. Click on 'GraphQL'
  3. Scroll down to 'Click "Play"' on GraphiQL
  4. See error

Expected behavior
Should see "Hello World!"

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Screenshots
image

Desktop (please complete the following information):
Browser name = Chrome
Full version = 87.0.4280.141
Major version = 87
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36
performance.memory = {
totalJSHeapSize: 63021506,
usedJSHeapSize: 59189210,
jsHeapSizeLimit: 2172649472
}

Additional context
Add any other context about the problem here.

Bug: Running start command doesn't works on Brave browser

Describe the bug
Running npm dev (start command) on next.js project does't work on brave browser by default. Booting the web container, Installing dependencies works successfully but running start command doesn't work.

If you open the console you may get following error :

Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
x.clearbitjs.com/v1/pk_cf7f6c8b720be71dfc730b02eb55b0bd/clearbit.min.js:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
js-agent.newrelic.com/nr-spa-1208.min.js:1 Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
registry.worker.7286dbe8d47d3473cde7be488b7d048fb59b05f2.js:6

Link to the blitz that caused the error
https://stackblitz.com/edit/nextjs-nee224

To Reproduce
Steps to reproduce the behavior:

  1. Open the blitz and run npm dev

Expected behavior
using npm dev should allow to

Screenshots
image

Desktop (please complete the following information):

  • OS: Ubuntu 20.04.2 LTS x86_64
  • Browser Brave
  • Version Version 1.24.85 Chromium: 90.0.4430.212 (Official Build) (64-bit)

Fix
This error might occur beacuse brave browser might block the cookies for stackblitz. For fix I've followed the given steps:

  1. Go to brave://settings/cookies
  2. Click add on sites that can always use cookies.
  3. Add https://[*.]stackblitz.com and click allow third-party cookies.

image

BUG: esmodule syntax doesn't work when setting type: "module" on package.json


name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''


Describe the bug
esmodule syntax doesn't work when setting type: "module" on package.json nor when renaming index.js to index.mjs

Link to the blitz that caused the error
https://stackblitz.com/edit/node-e2tzh5?file=index.mjs

To Reproduce
Steps to reproduce the behavior:

  1. Try running node index.mjs from the terminal

Expected behavior
Running the mjs file

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.212
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
performance.memory = {
totalJSHeapSize: 65041199,
usedJSHeapSize: 59647271,
jsHeapSizeLimit: 4294705152
}

Additional context
Add any other context about the problem here.

BUG: node-fetch/https.get doesn't work (Socket hang up)


name: Bug report
about: https://stackblitz.com/edit/node-zfkjjc?file=index.js
title: 'BUG: node-fetch/https.get doesn't work (Socket hang up)'
labels: 'http, socket, networking'
assignees: ''


Describe the bug
Unable to load remote data via node-fetch (or https module).

Link to the blitz that caused the error
https://stackblitz.com/edit/node-zfkjjc?file=index.js

Expected behavior
A clear and concise description of what you expected to happen.

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Desktop (please complete the following information):
Browser name = Brave
Full version = 90.0.4430.212
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
performance.memory = {
totalJSHeapSize: 56890553,
usedJSHeapSize: 50431077,
jsHeapSizeLimit: 4294705152
}

BUG: "UnknownError The user denied permission to access the database." when opening using incognito

---imagename: Bug report
about: Create a report to help us improve
title: 'Received UnknownError The user denied permission to access the database.' when opening project in incognito tab via Google Chrome.
labels: ''
assignees: ''


Describe the bug
I received an error when attempting to open a nodejs StackBlitz project in an incognito tab via Google Chrome. When I open the url via incognito, I see the StackBlitz message, 'Unable to connect to local.webcontainer.io', which I'd expect. However, when selecting the open button or project title link, a new window opens with an error, 'UnknownError The user denied permission to access the database'.

Link to the blitz that caused the error
https://express-in-browser--5000.local.webcontainer.io/

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://express-in-browser--5000.local.webcontainer.io/
  2. Click on either 'Open Project' or option 1 with your project title link.
  3. Open up console in new window
  4. See error

Expected behavior
User project should open with no non-logged in state.

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Screenshots

Screen Shot 2021-05-21 at 3 16 32 PM

**Desktop (please complete the following information):**![image](https://user-images.githubusercontent.com/37988868/119187816-d5f54f00-ba47-11eb-9daf-e4d0c30c21a8.png)Browser name = Chrome Full version = 90.0.4430.212 Major version = 90 navigator.appName = Netscape navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36 performance.memory = { totalJSHeapSize: 53737633, usedJSHeapSize: 51401537, jsHeapSizeLimit: 4294705152 }

Additional context
Add any other context about the problem here.

Add support for payment in the preview iframe

Is your feature request related to a problem? Please describe.

It would be great if the preview iframe included support for the payment request handler so that projects that make use of it can function correctly.

For instance, clicking the Google Pay button in the example while in the preview launches a new tab/window which is a workaround for when the payment request isn't supported. Ideally, the behavior should match the experience if you open the content in its own window (e.g. by clicking the Open in new window link) which shows a modal dialog (on Chrome)

Describe the solution you'd like

My proposed solution is to include payment to the iframe's allow attribute. This will allow the payment handler to be triggered by the content of the iframe.

Describe alternatives you've considered

My current workaround is to do some detection in the code and include instructions for the user to open the window in a new tab.

Example: https://stackblitz.com/edit/nextjs-nakdbt?file=pages%2Findex.js

Additional context

Clicking on the Google Pay button in the preview tab launches the payment sheet in a new window (not desirable behavior).

Clicking on the Google Pay button in its own window launches the payment sheet in a modal window (expected behavior on Chrome)

Previous feature request: https://twitter.com/aussoc/status/1359219567600390145

Bug: WASM-based npm package works only when stepping through in debugger

Describe the bug

Using a library that loads and runs WASM does not seem to run (a terminating log statement is not hit or error logged) unless the dev tools are open and you explicitly step through execution to the end.

Link to the blitz that caused the error
https://stackblitz.com/edit/node-vireo-hello-world

To Reproduce
Steps to reproduce the behavior:

  1. Open the blitz and run node index.js with devtools closed

  2. Note that the output shows Hello Node.js v14.16.0! but does not show an ascii art mandelbrot or the output done :D

    image

  3. Open the blitz and run node index.js with devtools open. Meticulously step through the code stepping into functions and stepping into async tasks (not running to a breakpoint).

  4. Note that everything seems to work correctly and print the above mentioned output 🤯

    runsfinedevtools

Expected behavior
Expect the mandelbrot ascii art and completion message to print without meticulously stepping through the code in the chrome debugger.

Screenshots
See above

Desktop (please complete the following information):

  • OS: Win 10 20H2 (OS Build 19042.985)
  • Browser Chrome
  • Version 90.0.4430.212 (Official Build) (64-bit)

Additional context
If I had to guess maybe there is an issue with async and waiting for tasks in the event queue to complete? How the heck would that even work without plugs into V8 itself or something funny like shimming zone.js into everything? (goes to mess with the example) I actually think this might be the issue, if I add a setInterval to keep the event queue alive it seems to print everything reliably: https://stackblitz.com/edit/node-vireo-hello-world-event-queue-keepalive

Edit: This is really freakin cool ♥

Discord link is invalid

Describe the bug
The invite link of Discord in the README.md is invalid. (There are two same links.)

Link to the blitz that caused the error

To Reproduce

  • click the link to join Discord
  • cannot join the Discord channel

Expected behavior

  • can join the Discord channel

Screenshots
invalid

Desktop (please complete the following information):

  • OS: macOS
  • Browser Google Chrome
  • Version Version 90.0.4430.212 (Official Build) (arm64)

Smartphone (please complete the following information):
N/A

Additional context
N/A

Support different registries

As the WebContainer installs fresh node_modules in each usage, it would be great to support different npm registry for fast installation in everywhere 😄

BUG: cannot importing private repo


name: cannot importing private repo
about: Create a report to help us improve
title: ''cannot import github repo

while importing error box says :
Error: Could not resolve reference "refs/heads/master".

clicking to top of files tab redirects to [repo link]/tree/null

Link to the blitz that caused the error
https://stackblitz.com/edit/nextjs-afxmy2

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
Just to import github repo

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.212
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
performance.memory = {
totalJSHeapSize: 63660623,
usedJSHeapSize: 56307547,
jsHeapSizeLimit: 2172649472
}

Additional context
Add any other context about the problem here.

BUG: Folders that you drag into the environment do not sync with the project


name: Bug report
about: Create a report to help us improve the Nextjs environment
title: ''
labels: ''
assignees: ''


Describe the bug
I copied a bunch of folders into the /pages directory and I could not open these newly added pages.
When I created the same folders manually, they worked well.

Link to the blitz that caused the error
https://stackblitz.com/edit/nextjs-mh5kn3?file=pages%2Finvestments%2Findex.js

To Reproduce
Steps to reproduce the behavior:

  1. Drag and drop some files / valid folders (a folder with an index.js) into the /pages directory of the nextjs project
  2. Try to route to these pages on the live server
  3. They re-route to a 404 page because for some reason, they are not recognised

Expected behavior
Once I drop any file / folder into the pages directory, they should automatically be saved and cause a hot reload of the live server.

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.93
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
performance.memory = {
totalJSHeapSize: 85509863,
usedJSHeapSize: 80044759,
jsHeapSizeLimit: 4294705152
}

Additional context
Nothing else I guess

BUG: Always wants to install 'next' even on bare Node project


name: Bug report
about: Create a report to help us improve
title: 'Always wants to install 'next' even on bare Node project'
labels: ''
assignees: ''


Describe the bug
I tried it in Brave - configured Shields to make it work in the browser. Then I installed it as desktop app. It now tries to always install 'next' (and fails) - even for plain Node.js projects

Link to the blitz that caused the error
https://stackblitz.com/edit/node-gantcb

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Version of webcontainer
Hash: 7286dbe8d47d3473cde7be488b7d048fb59b05f2

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.93
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
performance.memory = {
totalJSHeapSize: 85706543,
usedJSHeapSize: 79518563,
jsHeapSizeLimit: 4294705152
}

Additional context
Add any other context about the problem here.

BUG: npx does not look for local .bin

Describe the bug
Usually when executing npx <cli_name>, npx will look for local node_modules/.bin before trying to install the CLI from a registry. Although, this does not work as you can see in the screenshot, nestjs/cli is installed as a devDependencies
image

Link to the blitz that caused the error
https://stackblitz.com/edit/github-yid42f?file=package.json

To Reproduce
Steps to reproduce the behavior:

  1. Open Terminal
  2. Try npx nest

Expected behavior
npx nest should execute the already-installed nestjs/cli

Desktop (please complete the following information):

  • OS: [e.g. iOS]: MacOS
  • Browser [e.g. chrome, safari]: Chrome
  • Version [e.g. 22]

Docs: npm plans relating to native binaries and postinstall scripts

Hello, the "Limitations" > "Native binaries and NPM postinstall scripts" section of this repo's README contains the statement that there are "no plans on remediating the behavior".

https://github.com/stackblitz/webcontainer-core/blob/main/README.md#limitations

If you weren't already aware, yarn has a public RFC relating to this - see yarnpkg/berry#2751

In response, the npm team are now also planning an RFC - see yarnpkg/berry#2751 (comment)

Although these proposals won't solve the problem on their own, they are a very welcome step towards doing so, and may qualify as "plans on remediating the behavior". 🤞

Feature: Autorun the start script if included in package.json

Is your feature request related to a problem? Please describe.
I'm frustrated when I open a WebContainer and I have to manually start it to see the behavior.

Describe the solution you'd like
As a WebContainer author I'd like the container to start running automatically by including a script named "start" in my package.json.

Describe alternatives you've considered
Can't think of any workaround to have a script auto start.

Additional context
N/a

BUG: `for` doesn't quite work in jsh

Describe the bug
for doesn't quite work in jsh

Link to the blitz that caused the error

To Reproduce
Steps to reproduce the behavior:

for i in *; do echo $i; done

gives an error of e.Assigns is not iterable

Expected behavior
Print every file in the folder

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.