-
Notifications
You must be signed in to change notification settings - Fork 5
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
Cannot find module '@alpacahq/typescript-sdk' or its corresponding type declarations. (tsserver 2307) #4
Comments
No idea, but i think it's because the package is only exported as |
Hmm. I'm unable to recreate this. I'm seeing the types inferred.
// package.json
{
"type": "module",
"dependencies": {
"@alpacahq/typescript-sdk": "0.0.29-preview",
"ts-node": "^10.9.2"
},
"devDependencies": {
"typescript": "^5.4.5"
}
} // tsconfig.json
{
"compilerOptions": {
"module": "NodeNext",
"target": "ES6",
"moduleResolution": "NodeNext"
}
} // test.ts
import { createClient } from "@alpacahq/typescript-sdk";
const client = createClient({
key: "my-paper-key",
secret: "my-paper-secret",
});
client.getAccount().then(console.log);
client.getAsset({ symbol_or_asset_id: "AAPL" }).then(console.log); What node version are you on? What ts-node version are you on? |
I was using I am node version typescript version |
I restarted my computer and started with fresh new project, minimal weird error when i attempt to run
|
Try latest |
ok I tested, still same error 🫤 |
I was able to get it working with your exact configuration. Try latest again 😄.
|
I'm trying a ton of different things, but still same error. I am not sure what is happening brother, but still not working.
package.json
ts config{
"compilerOptions": {
"module": "ESNext",
"resolveJsonModule": true,
"esModuleInterop": true,
"target": "esnext",
"noImplicitAny": true,
"noEmit": true,
"moduleResolution": "NodeNext",
"sourceMap": true,
"baseUrl": ".",
"forceConsistentCasingInFileNames": true,
"types": [
"node"
]
},
"exclude": [
"./node_modules"
]
} same error
|
@zacharytyhacz have you figured it out already ? I came to the same issue and managed to figure out that my tsconfig.json was misconfigured by manually transpiling using the "tsc" command and inspecting the generated JS which contained a require statement instead of the import statement so it was evident that the tsconfig was somehow off. |
I did not, I just switched to |
For the For the And from my testing |
I have no idea why is happening
All I did was run
npm install @alpacahq/typescript-sdk
and it successfully installed and my project has no vulnerabilities.I tried all sorts of different tests and typescript just is not finding this package.
tsconfig.json
package.json
package-lock.json
When I play around with my
tsconfig.json
, sometimes this shows:this makes the error in my nvim go away
But when I run with
nodemon
I get this errorThe text was updated successfully, but these errors were encountered: