-
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
[bundle] Bundled code doesn't work as expected #8770
Comments
When you say "doesn't work" what happens? What version of Deno? |
@kitsonk I updated the issue with the error and Deno version. |
Might be caused by deno messing up code execution order. In my current version ( 1.6.0 ). This line of code in my repo: // using oak framework
const app = new Application();
app.use(router.routes());
app.use(router.allowedMethods());
app.addEventListener("listen", (ctx) => {
console.log(`Serving requests at ${ctx.hostname}:${ctx.port}`)
})
await app.listen( {hostname:config.hostname,port:config.port} ) will be bundled like this const app2 = new Application();
app2.addEventListener("listen", (ctx)=>{
console.log(`Serving requests at ${ctx.hostname}:${ctx.port}`);
});
await app2.listen({
hostname: config.hostname,
port: config.port
});
// some hundreds of lines later
app2.use(router.routes());
app2.use(router.allowedMethods()); causing an error like this:
My solution would be not to bundling the module until deno fix this issue in future versions. |
I've got the same problem as @Nexxkinn . I'm developing an API using oak with Deno 1.6.1 by using Typescript.
Seems bundle and compile has the same issue ? |
cc/ @kdy1 |
@kitsonk I'm now working to fix this issue. (Preserving order of statements within single module would be solution to this issue.) Exam is over :) |
No problem! 😁 Hopefully the exams went well! |
I think this is fixed by swc-project/swc#1264 |
Looking forward for this fix, thank you very much @kdy1 ! |
This is fixed by new version of swc_bundler. (I've added test for it) |
I still have this problem with Deno 1.6.3. |
This will be fixed in 1.7.0 which will be released next week, January 19th. |
Code bundled with
deno bundle
works different thandeno run
.Steps to reproduce it:
This code works:
But this code doesn't:
Expected result:
resize
function should return an Uint8Arrray for the resized image and than should be written on the disk.Actual result:
Deno version: 1.6.1
I used this image but should work with any .jpg file.
The text was updated successfully, but these errors were encountered: