Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts-mocha fails in typescript v5 on native projects #127

Open
heyAyushh opened this issue Oct 7, 2024 · 1 comment
Open

ts-mocha fails in typescript v5 on native projects #127

heyAyushh opened this issue Oct 7, 2024 · 1 comment

Comments

@heyAyushh
Copy link
Contributor

 Exception during run: TypeError: Unknown file extension ".ts" for  /solana/program-examples/basics/hello-solana/native/tests/test.ts
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:214:9)
    at defaultGetFormat (node:internal/modules/esm/get_format:240:36)
    at defaultLoad (node:internal/modules/esm/load:123:22)
    at ModuleLoader.load (node:internal/modules/esm/loader:567:7)
    at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:442:45)
    at ModuleJob._link (node:internal/modules/esm/module_job:106:19) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}

To fix this temporarily use these specific versions in node

  "devDependencies": {
    "@types/bn.js": "^5.1.0",
    "@types/chai": "^4.3.1",
    "@types/mocha": "^9.1.1",
    "chai": "^4.3.4",
    "mocha": "^9.0.3",
    "solana-bankrun": "^0.3.0",
    "ts-mocha": "^10.0.0",
    "typescript": "^4.3.5"
  },
@deauthe
Copy link

deauthe commented Oct 18, 2024

some say it's probably an issue with mocha. Any updates on this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants