qstash-js: v2: Module not found: Can't resolve '@upstash/qstash/nextjs'
npm ls @upstash/qstash:
└── @upstash/qstash@2.0.0
After the update, my application can’t find the qstash/nextjs path - when I click on it using vscode intellisense, it jumps to node_modules/@upstash/qstash/dist/nextjs.d.ts just fine. I am confused, any ideas why this may happen in a not too exotic nextjs setup?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 30 (12 by maintainers)
@bastienrobert yeah that was a mistake on my part I’ve reverted it in v2.1.2
import { verifySignature } from '@upstash/qstash/dist/nextjs'this still works, and I’ll figure out a way to make it nicer hopfully soon 😃Okay. This issue will be fixed ASAP.
In my case, for both imports (with and without /dist in the import path) I’m getting the following error:
I’m using @upstash/qstash v2.5.2 (latest when writing this) and next v13.4.19.
For anyone looking for a solution As I just need the verifySignature method from the library, I have just copy-pasted the source code that can be found here: https://github.com/upstash/qstash-js/blob/main/src/nextjs.ts
The code:
Thank you, I can confirm this resolved my build issues
I can confirm I’m having the same issue when upgrading from 2.5.0 to 2.5.4 and a workaround of copying https://github.com/upstash/qstash-js/blob/main/src/nextjs.ts worked for me as well. I can’t share repro in repo as it’s not open sourced but I do have an error if that helps:
@sitoftonic Weird. I’ll check the SDK and make sure it doesn’t require copy-paste. I tested edge and serverless everything was fine I actually deployed and check them myself. Maybe the pages directory causing this.
Also can add these to your tsconfig in my case they were causing the issue.
yeah this should work, but it’s ugly
Should be fixed here: https://github.com/upstash/qstash-js/releases/tag/v2.5.5. I personally tested both app and pages to make sure they are good. Lemme know if issue still persists.
Same issue here
Nextjs.verifySignaturedoesn’t seem to work.Dang. I tried in a few setups and it worked. Can you try and reproduce it in a fresh project please?