-
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
Doesn't work with ESM #12
Comments
When I read the error, the problem is that you are using |
Sorry, I should have included the stack trace to make things clearer ... and now I've stopped using Supertest and can't easily repro the error. However, the core problem was that:
wasn't coming from my code ... it was coming from Supertest code. My code is using ESM, and only has imports. |
if your problem comes from using ESM in CJS project like error message suggests, try dynamic imports like below. async function _load() {
const server = await import('nextjs-http-supertest')
// your codes
} |
I tried to use this library, but apparently, it can't handle ES Modules (ie.
"type": "module"
inpackage.json
),.When I tried to run it, it immediately failed after trying to require one of my (ESM) API endpoints (
feedback.js
).The text was updated successfully, but these errors were encountered: