-
-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
Describe the bug
rustyscript v0.12.3 fails to build, giving a serde::__private import error. The issue is caused by a breaking change in serde that found itself upstream to deno_ast v0.49.0 which is the version pinned by rustyscript in its Cargo.toml.
Error:
error[E0432]: unresolved import `serde::__private`
--> swc_config-3.0.0\src\types\bool_or_data.rs:128:20
|
128 | use serde::__private::de;
| ^^^^^^^^^ could not find `__private` in `serde`
To Reproduce
Tested on both Windows and Ubuntu (via WSL2). Steps to reproduce the behavior:
- Create a new Rust project:
cargo new test-rustyscript && cd test-rustyscript - Add rustyscript:
cargo add rustyscript --features fs_import,url_import - Set environment variable to avoid NASM requirement (due to deno using the
aws-lc-rscrate, see here):- Windows (PowerShell):
$env:AWS_LC_SYS_NO_ASM = "1" - Linux/macOS (Bash):
export AWS_LC_SYS_NO_ASM=1
- Windows (PowerShell):
- Build:
cargo build - See error (build fails with
serde::__privateerror)
Expected behavior
The project should build successfully without errors.
Root Cause
rustyscript's Cargo.toml (line 176) pins deno_ast = "=0.49.0", which depends on the broken swc_config v3.0.0.
rustyscript v0.12.3
└─ deno_ast v0.49.0 ← Pinned to exact version
└─ swc_config v3.0.0 ← Has serde::__private bug
The Fix
Change this line in rustyscript's Cargo.toml (line 176):
- deno_ast = { version = "=0.49.0", features = ["transpiling", "cjs"] }
+ deno_ast = { version = "0.50", features = ["transpiling", "cjs"] }I tested it, and it compiles fine once deno_ast's version is bumped.
Why this works:
deno_ast v0.50+usesswc_config v3.1.2(which has the serde fix)deno_ast v0.49.0usesswc_config v3.0.0(broken)
0x-jerry and MadelineRitchie
Metadata
Metadata
Assignees
Labels
No labels