When there is a syntax error in the widget js code, Deskulpt will crash. This happens at commit 442cf1, the head commit when I submit this issue. Below is a minimal example to reproduce this bug.
const React = window.__DESKULPT__.defaultDeps.React;
// Syntax error here, misspell "const" as "conts", will crash Deskulpt
conts bannerText = "My Simple Banner";
function Banner() {
return (
<div>
<h1>{bannerText}</h1>
</div>
);
}
export default {
render: () => <Banner />,
};
And is the error message produced when Deskulpt crashes. It happens when I add this widget to the widgets folder and render. I run Deskulpt with npm run tauri dev.
error: Expected ';', '}' or <eof>
--> \\?\C:\Users\eiger\AppData\Roaming\com.tauri.deskulpt\widgets\ok-simple-banner\src\App.jsx:3:7
|
3 | conts bannerText = "My Simple Banner";
| ----- ^^^^^^^^^^
| |
| This is the expression part of an expression statement
thread 'main' panicked at src\bundler.rs:171:21:
FATAL: Failed to parse module
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[0406/173441.713:ERROR:window_impl.cc(121)] Failed to unregister class Chrome_WidgetWin_0. Error = 0
@Charlie-XIAO @ROMEEZHOU You might want to check this out since we are writing tests for bundler this week
When there is a syntax error in the widget js code, Deskulpt will crash. This happens at commit 442cf1, the head commit when I submit this issue. Below is a minimal example to reproduce this bug.
And is the error message produced when Deskulpt crashes. It happens when I add this widget to the widgets folder and render. I run Deskulpt with
npm run tauri dev
.@Charlie-XIAO @ROMEEZHOU You might want to check this out since we are writing tests for bundler this week