You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let scripts = ["app/App.tsx".to_string()];ifletErr(e) = metacall::load_from_file("ts",&scripts){println!("{}", e);panic!();}
When cargo run was ran it should properly parse the tsx and provide the desired result
Current Behavior
Instead when cargo run is ran it throws the above mentioned error and panics like this:
Exception in load_from_file /home/tamizh/Metacall_React-Actix_Example/target/debug/App.js:6
return (<h1> Hello {text}</h1>);
^
SyntaxError: Unexpected token '<'
at Object.compileFunction (node:vm:360:18)
at wrapSafe (node:internal/modules/cjs/loader:1088:15)
at Module._compile (node:internal/modules/cjs/loader:1123:27)
at Object.writeFile (/usr/local/lib/bootstrap.ts:181:15)
at Object.writeFile (/usr/local/lib/node_modules/typescript/lib/typescript.js:17502:14)
at printSourceFileOrBundle (/usr/local/lib/node_modules/typescript/lib/typescript.js:100995:16)
at emitJsFileOrBundle (/usr/local/lib/node_modules/typescript/lib/typescript.js:100873:13)
at emitSourceFileOrBundle (/usr/local/lib/node_modules/typescript/lib/typescript.js:100796:13)
at forEachEmittedFile (/usr/local/lib/node_modules/typescript/lib/typescript.js:100517:34)
at Object.emitFiles (/usr/local/lib/node_modules/typescript/lib/typescript.js:100776:9)
MetaCall failed to load script from file
thread 'main' panicked at 'explicit panic', src/main.rs:37:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
However when I place the contents in app/ in the root directory like this:
It works as expected
Possible Solution
The metacall module should be able to detect the tsconfig.json file inside the specifed paths too
The text was updated successfully, but these errors were encountered:
🐛 Bug Report
While interoping Rust with .tsx the tsconfig.json is not picked up properly and throws this error when ran
cargo run
:Expected Behavior
The app directory looks something like this:
The
app/App.tsx
looks like this:Its called in Rust like this:
When
cargo run
was ran it should properly parse the tsx and provide the desired resultCurrent Behavior
Instead when
cargo run
is ran it throws the above mentioned error and panics like this:However when I place the contents in
app/
in the root directory like this:It works as expected
Possible Solution
The metacall module should be able to detect the tsconfig.json file inside the specifed paths too
The text was updated successfully, but these errors were encountered: