Skip to content

Can't compile due to bug in dependency deno_ast=0.49.0 #409

Open

Description

@ozaner

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:

  1. Create a new Rust project: cargo new test-rustyscript && cd test-rustyscript
  2. Add rustyscript: cargo add rustyscript --features fs_import,url_import
  3. Set environment variable to avoid NASM requirement (due to deno using the aws-lc-rs crate, see here):
    • Windows (PowerShell): $env:AWS_LC_SYS_NO_ASM = "1"
    • Linux/macOS (Bash): export AWS_LC_SYS_NO_ASM=1
  4. Build: cargo build
  5. See error (build fails with serde::__private error)

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+ uses swc_config v3.1.2 (which has the serde fix)
  • deno_ast v0.49.0 uses swc_config v3.0.0 (broken)

Activity

  1. changed the title [-]Can't compile due to bug in transitive dependency `deno_ast=0.49.0`[/-] [+]Can't compile due to bug in dependency `deno_ast=0.49.0`[/+] on Nov 14, 2025
  2. utyfua commented on Nov 14, 2025

    @utyfua
    Contributor

    Dublicate of #399
    I'm waiting for the new deno version with deno_core v0.363.0 or higher before submitting a PR.

  3. eirikb commented on Dec 4, 2025

    @eirikb

    FWIW, to build with web feature, also add deno_media_type = "=0.2.1" and use serde = "=1.0.215" instead of 1.0.219...

  4. ayushjain17 commented on Jan 18, 2026

    @ayushjain17

    is someone still looking to fix this ?
    @utyfua deno_core has released v0.380.0

  5. Remigius2011 commented on Feb 15, 2026

    @Remigius2011

    deno_core = "0.385.0", as of now. but our experiments have shown that deno is nowadays not very integration friendly.

  6. Remigius2011 commented on Feb 15, 2026

    @Remigius2011

    @ozaner does it only compile, or have you tested it? if it is more or less usable after updating deno_ast to 0.50 (which is still outdated), we could just fork it until rustyscript has settled to a newer working combination of dependencies.

  7. utyfua commented on Feb 15, 2026

    @utyfua
    Contributor

    @Remigius2011 You can try to use unreleased version

    # https://github.com/rscarson/rustyscript/pull/415
    rustyscript = { git = 'https://github.com/rscarson/rustyscript', rev = 'e39529eac2c5d37cfcbb7d7d63da7264d7a5afdb' }
    deno_core = "0.380.1"
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions