Open orimdominic opened 1 year ago
Hi @orimdominic, thanks for providing context on this bug. I'll try to replicate it on my end and get back to you
Hi @orimdominic I've been able to replicate the bug. We'll work on a fix and push it out as soon as possible.
@orimdominic we've just published the fix to this issue in PR #6. Kindly upgrade to v1.0.1 and try again. You might get an error about the resource (e.g transaction) not being a type of paystack
, but that's just a typing error that can be ignored for now. I'll work on the types in another PR.
I'm still getting a type error when importing even after upgrading to v1.0.1
Hey @waptik I somehow missed this. Are you still getting this error? Should the issue be reopened?
Hey @waptik I somehow missed this. Are you still getting this error? Should the issue be reopened?
Yes ooo, i am still getting that error. I think it should be reopened since it occurs at the import level
Can you share what your tsconfig
looks like?
Bumping this up again....
I still have this issue despite using the v1.0.1
This is what my tsconfig looks like
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "es2017",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true,
"skipLibCheck": true,
"strictNullChecks": false,
"noImplicitAny": false,
"strictBindCallApply": false,
"forceConsistentCasingInFileNames": false,
"noFallthroughCasesInSwitch": false,
}
}
cc: @damilola-paystack
Sincere apologies for the delay here. Q1 planning and setting up for the year pushed this further down the backlog. However, it's been prioritised now and we'll push a permanent fix in early Q2.
Hi, are there still any plans to fix this issue?
Hello @damilola-paystack Is there any resolution on this? I am having the same issue that @waptik and @dubems are having For context, here is information you may need and if you need more, you can make a request.
Editor: VSCode 1.82.1 Node.js version: v20.9.0 Typescript version: ^4.9.5
{
"compilerOptions": {
"ignoreDeprecations": "5.0",
"target": "ES6",
"module": "commonjs" ,
"strict": true,
"sourceMap": true,
"outDir": "./build",
"rootDir": "./src",
"lib": ["ESNext"],
"forceConsistentCasingInFileNames": true,
"removeComments": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"strictNullChecks": true,
"isolatedModules": true,
"noImplicitAny": true,
"noImplicitThis": true,
"skipLibCheck": true,
"importsNotUsedAsValues": "error"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "build"]
}
Please when is this issue going to be fixed?😓
almost two years and still not fixed
Hey folks, apologizing right now is literally rubbing salt on injury. For some reason, the notifications from this thread wasn't getting to our internal tool. I've assigned the issue to myself and will pick up work on it.
Hi @ogheneovo12 @orimdominic @R4heem-Orekoya @daudujohn thanks for the patience so far. A beta release has been published, which can be gotten by running:
npm i @paystack/paystack-sdk@1.2.1-beta.1
Kindly help test and share your feedback.
PS: We've now switched to named export which means you'd now need to use curly braces to access the Paystack class i.e.
import { Paystack } from '@paystack/paystack-sdk'
for ESM or
const { Paystack } = require('@paystack/paystack-sdk')
for CJS
Looking forward to your feedback.
Hello @damilola-paystack, I have tested this with @paystack/paystack-sdk@1.2.1-beta.1
and can confirm that the error does not come up with Typescript 5.5.2
🚀 💪🏽 🙌🏽
However, I do not get suggestions for methods and fields from the paystack object when created
import { Paystack } from '@paystack/paystack-sdk'
const p = new Paystack("you-cant-see-me")
p. // no suggestions for methods like `charge` and `customer`
Thanks for the feedback @orimdominic. Yeah, I noticed the types aren't built after compilation. This is being looked into but we want to ensure the SDK is stable and usable first.
@damilola-paystack I tested with @paystack/paystack-sdk": "^1.2.1-beta.1
version using CommonJS where I get this error
{ status: undefined, message: "'sk_test_XXXXXX' not a valid key=value pair (missing equal-sign) in Authorization header: 'Bearer sk_test_XXXXXX'.", data: undefined }
when initializing the paystack object.
Here is a code snippet
const { Paystack } = require('@paystack/paystack-sdk')
const paystack = new Paystack("sk_test_XXXXXX")
Hey @steve-jr it seems you didn't complete typing out your feedback. Can you try update so we understand what the issue is?
@damilola-paystack I tested with
@paystack/paystack-sdk": "^1.2.1-beta.1
version using CommonJS where I get this error{ status: undefined, message: "'sk_test_XXXXXX' not a valid key=value pair (missing equal-sign) in Authorization header: 'Bearer sk_test_XXXXXX'.", data: undefined }
when initializing the paystack object.
Here is a code snippet
const { Paystack } = require('@paystack/paystack-sdk') const paystack = new Paystack("sk_test_XXXXXX")
@damilola-paystack It is updated now.
This is strange @steve-jr. I tried replicating to no avail. Can you try making a direct API call in the same project without using the library?
Describe the bug Cannot construct object from Paystack import after following documentation
To Reproduce Steps to reproduce the behavior:
@paystack/paystack-sdk
Expected behavior There should be no errors and the returned object from the
Paystack
constructor should have autocomplete suggestionsScreenshots![Screenshot from 2022-10-25 08-44-29](https://user-images.githubusercontent.com/37955249/197715158-f3cde3ae-1d33-4b11-bc63-a3feda08f970.png)
Additional context Editor: VSCode Node.js version: v16.17.1 Typescript version: ^4.7.4