Skip to content

Typescript generator do not use .js extension for relative import #3941

@wighawag

Description

@wighawag

fuels-ts SDK Version

[email protected]

Toolchain Versions

Default host: x86_64-unknown-linux-gnu fuelup home: /home/wighawag/.fuelup Installed toolchains -------------------- latest-x86_64-unknown-linux-gnu (default) testnet-x86_64-unknown-linux-gnu (override) active toolchain ---------------- testnet-x86_64-unknown-linux-gnu (override), path: /home/wighawag/dev/local/fuel/first-fuel/onchain/fuel/fuel-toolchain.toml forc : 0.69.1 - forc-client - forc-call : 0.69.1 - forc-deploy : 0.69.1 - forc-run : 0.69.1 - forc-submit : 0.69.1 - forc-crypto : 0.69.1 - forc-debug : 0.69.1 - forc-doc : 0.69.1 - forc-fmt : 0.69.1 - forc-lsp : 0.69.1 - forc-migrate : 0.69.1 - forc-node : 0.69.1 - forc-publish : 0.69.1 - forc-tx : 0.69.1 - forc-wallet : 0.15.1 fuel-core : 0.44.0 fuel-core-keygen : 0.44.0 fuels versions -------------- forc : 0.74 forc-wallet : 0.74

Node.js Version

v22.15.0

Browser

No response

Operating System

Linux pop-os 6.12.10-76061203-generic x86_64

Describe the Problem

In modern js (running in browser but also supprted by nodejs) it is now recommended to use .js extension for relative import

Typescript fails to compile when using nodenext for moduleResolution

 Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './TestContract.js'?

Code Snippet

Contract ABI

Errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions