-
Notifications
You must be signed in to change notification settings - Fork 63
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
JavaScript env for browsers is broken #246
Comments
When I run
Looks like |
Repo is available here: |
@temeddix hi there, thanks for asking this question! - To make sure I understand correctly what you're asking: you're trying to use code transpiled by If that's right, can I ask why you're doing that? |
Thanks for the quick reply :) Basically, I wish to write this: <!DOCTYPE html>
<html>
<head>
<title>Sample HTML Page</title>
</head>
<body>
<h1>My HTML Page</h1>
<script src="jco_test.js"></script>
</body>
</html> instead of this: <!DOCTYPE html>
<html>
<head>
<title>Sample HTML Page</title>
</head>
<body>
<h1>My HTML Page</h1>
<script type="importmap">
{
"imports": {
"@bytecodealliance/preview2-shim/cli": "./packages/preview2-shim/lib/browser/cli.js",
"@bytecodealliance/preview2-shim/clocks": "./packages/preview2-shim/lib/browser/clocks.js",
"@bytecodealliance/preview2-shim/filesystem": "./packages/preview2-shim/lib/browser/filesystem.js",
"@bytecodealliance/preview2-shim/http": "./packages/preview2-shim/lib/browser/http.js",
"@bytecodealliance/preview2-shim/io": "./packages/preview2-shim/lib/browser/io.js",
"@bytecodealliance/preview2-shim/logging": "./packages/preview2-shim/lib/browser/logging.js",
"@bytecodealliance/preview2-shim/poll": "./packages/preview2-shim/lib/browser/poll.js",
"@bytecodealliance/preview2-shim/random": "./packages/preview2-shim/lib/browser/random.js",
"@bytecodealliance/preview2-shim/sockets": "./packages/preview2-shim/lib/browser/sockets.js",
"jco": "./src/browser.js"
}
}
</script>
<script type="module" src="jco_test.js"></script>
</body>
</html> With this |
@yoshuawuyts @guybedford I could reproduce this issue. A basic hello world app does not load currently load in the browser. |
In my humble opinion, on browsers, it will be good to open a file dialog that requires user selection whenever file read/write syscall is made. Currently the support status of file operation for the browser is just written as N/A. |
Thanks for posting, yes the browser build is currently not working. This was due to recent IO work, where the browser build is not currently tested in CI ( I've added a fix to the current IO PR in cf6de64. |
Hi, I've been testing
jco
on NodeJS and it has been working well. Great project!However, I couldn't get it to compile JavaScript files for the browser(without
import
andexport
s). How can I do that? I dug in the docs and guides, but no explanation was there that I could find. Do I have to use Webpack or Vite to transpile ES JavaScript to Browser JavaScript?The text was updated successfully, but these errors were encountered: