Skip to content

Issues with TypeScript and ts-node in Solana Project #10

@packetlost

Description

@packetlost

I am experiencing persistent issues with my Solana compressed NFTs project using this repository.

Issue Summary:

  • Running TypeScript files (ts-node and node --loader ts-node/esm) consistently fails with ERR_UNKNOWN_FILE_EXTENSION.
  • The error persists even after cleaning cache, reinstalling dependencies, and modifying tsconfig.json/package.json.
  • Modules that exist (@/utils/helpers) are sometimes not found despite being in the project structure.

Steps Taken So Far:

  • Reinstalled all dependencies (rm -rf node_modules package-lock.json yarn.lock dist && yarn cache clean && yarn install).
  • Tried multiple execution commands:
  • yarn start
  • node --loader ts-node/esm scripts/mint_compressed_nft.ts
  • yarn ts-node --project tsconfig.json scripts/mint_compressed_nft.ts
  • node --require ts-node/register scripts/mint_compressed_nft.ts
  • Checked and modified tsconfig.json and package.json for proper module resolution.
  • Verified that required modules exist (utils/helpers.ts is present but sometimes is "not found").
  • Tested on different Node.js versions but the issue persists.

Error Messages:

Example 1:
TypeError: Unknown file extension ".ts" for /home/rosy/solana-compressed-nfts/compressed-nfts/scripts/mint_compressed_nft.ts
Example 2:
Error: Cannot find module '@/utils/helpers'

Request for Assistance:

  • Could this be a GitHub repo issue or an NPM/Yarn caching issue?
  • Is there a way to force TypeScript to properly resolve modules without randomly failing?
  • Any debugging steps beyond yarn cache clean and node_modules reset?

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