bytecodealliance / javy

JS to WebAssembly toolchain
Apache License 2.0
2.1k stars 101 forks source link

Urgent help required : How to debug this ? Getting error at some line no in function.mjs #625

Closed redoC-A2k closed 3 months ago

redoC-A2k commented 3 months ago

What is your question?

This is the error I am getting when compiling a js file with our extended javy

called `Result::unwrap()` on an `Err` value: Uncaught SyntaxError: invalid property name
    at function.mjs:148

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: JS compilation failed
import { Hono } from "hono";

const app = new Hono();

app.get("/",(c)=>{
    // return c.text({"message":"Hello World!"});
    return c.text("hello world")
})

app.notFound((c) => {
    return c.text("404 not found", 404);
});

app.fire();

I compiled a output file esbuild and then compiling output js file with javy . But unable to determine where this uncaught syntax error happening in my js code. Please help me

redoC-A2k commented 3 months ago

I basically want to know what is written at line 148 in function.mjs file . So that I can debug that .

redoC-A2k commented 3 months ago

Can anybody help please

saulecabrera commented 3 months ago

I compiled a output file esbuild and then compiling output js file with javy .

The best bet in this situation is to inspect the file that esbuild created and inspect the contents of line 148. Have you tried that?

redoC-A2k commented 3 months ago

So does the file created by esbuild maps directly to function.mjs ?

saulecabrera commented 3 months ago

function.mjs is simply the name given to the file containing the JS source passed to Javy. In that sense if an error is reported in function.mjs you should look at the file, line and column of the file created by esbuild.

redoC-A2k commented 3 months ago

Ohk , thanks for helping .