Seems to be broken
robtweed opened this issue · 5 comments
I've come back to Nodebox after some months, only to find that my previously working examples no longer work. The odd thing is that your online version here works:
https://codesandbox.io/p/devbox/priceless-bash-nlrrz4
I've stripped back my standalone vanilla JS version to this - based on the example from your version above:
(async () => {
const {Nodebox} = await import('https://unpkg.com/@codesandbox/nodebox@0.1.8/build/index.mjs');
const emulator = new Nodebox({
iframe: document.getElementById('preview'),
});
await emulator.connect();
await emulator.fs.init({
'package.json': JSON.stringify({
name: 'my-app',
dependencies: {
express: "4.18.2"
}
}),
'index.js': `const express = require('express');
const app = express();
const port = 3000;
app.get('/', (req, res) => {
res.send('Hello world')
});
app.listen(port, () => {
console.log(\`Example app listening on port \${port}\`)
});`
});
const shell = emulator.shell.create();
const {id} = await shell.runCommand('node', ['index.js']);
const { url } = await emulator.preview.getByShellId(id);
console.log(url);
})();
When I try to connect using the URL shown in the console, it hangs and then I'm told it can't connect.
Could not connect to "nu13cex-3000.nodebox.codesandbox.io"
This server couldn't be reached. Make sure the node script is running and a server is started on port: "3000"
I see the following errors in the console:
https://nu13cex-3000.nodebox.codesandbox.io
__csb_sw.at3powcctjnrkzffq3qyf5kkzqljh91.js:105 Uncaught (in promise) DOMException: Failed to execute 'postMessage' on 'MessagePort': A ReadableStream could not be cloned because it was not transferred.
at _0x2e1433 (https://nu13cex-3000.nodebox.codesandbox.io/__csb_sw.at3powcctjnrkzffq3qyf5kkzqljh91.js:105:13782)
_0x2e1433 @ __csb_sw.at3powcctjnrkzffq3qyf5kkzqljh91.js:105
await in _0x2e1433 (async)
_0x63346a @ __csb_sw.at3powcctjnrkzffq3qyf5kkzqljh91.js:105
_0x3ea396 @ __csb_sw.at3powcctjnrkzffq3qyf5kkzqljh91.js:105
(anonymous) @ __csb_sw.at3powcctjnrkzffq3qyf5kkzqljh91.js:105
The FetchEvent for "https://nu13cex-3000.nodebox.codesandbox.io/cdn-cgi/rum?" resulted in a network error response: the promise was rejected.
Promise.then (async)
(anonymous) @ __csb_sw.at3powcctjnrkzffq3qyf5kkzqljh91.js:105
__csb_sw.at3powcctjnrkzffq3qyf5kkzqljh91.js:105 Uncaught (in promise) Error: Failed to handle POST https://nu13cex-3000.nodebox.codesandbox.io/cdn-cgi/rum? request: no response received from the BroadcastChannel within timeout. There's likely an issue with the bridge/worker communication.
at __csb_sw.at3powcctjnrkzffq3qyf5kkzqljh91.js:105:15526
(anonymous) @ __csb_sw.at3powcctjnrkzffq3qyf5kkzqljh91.js:105
setTimeout (async)
_0x63346a @ __csb_sw.at3powcctjnrkzffq3qyf5kkzqljh91.js:105
_0x3ea396 @ __csb_sw.at3powcctjnrkzffq3qyf5kkzqljh91.js:105
(anonymous) @ __csb_sw.at3powcctjnrkzffq3qyf5kkzqljh91.js:105
v84a3a4012de94ce1a686ba8c167c359c1696973893317:1 POST https://nu13cex-3000.nodebox.codesandbox.io/cdn-cgi/rum? net::ERR_FAILED
It would be good to get it working again - any ideas?
Many thanks
Seems like an issue with the network connection or cloudflare?
Works fine for me right now
Unfortunately it doesn't work for me. My network connections are fine for everything else I do. Any suggestions for things that I can check/debug would be appreciated.
Maybe a different browser or an incognito tab (no extensions)?
Maybe a different browser or an incognito tab (no extensions)?
Tried Chrome and Firefox and incognito - no change
Maybe a different browser or an incognito tab (no extensions)?
Tried Chrome and Firefox and incognito - no change
Tried on several different machines too