hi, I switched my node application (from commonjs)...
# orm-help
r
hi, I switched my node application (from commonjs) to type es module, and now my prisma client is throwing a timeout error in my async/await methods (sqlite connector)
Copy code
```
ready = true;
ready && sync();

const sync = async () => {
  /* some logic * /
  jsonCollection.length &&
    (await upsertManyA(
      jsonCollection.filter((obj) => obj.startsWith(A))
    ));
  jsonCollection.length &&
    (await upsertManyB(
      jsonCollection.filter((obj) => obj.startsWith(B))
    ));
  jsonCollection.length &&
    (await upsertManyC(
      jsonCollection.filter((obj) => obj.startsWith(C))
    ));
  /* finish */
};
```
const upsertManyA, upsertManyB, upsertManyC
are
async
methods that each make an
async
request to an api service then perform an
async
prisma upsert
upsertManyA
(first method) runs normally, but
upsertManyB
(second method) throws a timeout error everytime when it starts. All async/await methods above are expected to run in serial
Copy code
node_modules/@prisma/client/runtime/index.js:30855
[0]       throw new PrismaClientUnknownRequestError(message, this.client._clientVersion);
[0]             ^
[0]
[0] PrismaClientUnknownRequestError:
[0] Invalid `prisma.notAvailable.upsert()` invocation:
[0]
[0]
[0] Error occurred during query execution:
[0] ConnectorError(ConnectorError { user_facing_error: None, kind: ConnectionError(Timed out during query execution.) })
[0]     at RequestHandler.handleRequestError (/node_modules/@prisma/client/runtime/index.js:30855:13)
[0]     at RequestHandler.request (/node_modules/@prisma/client/runtime/index.js:30834:12)
[0]     at async PrismaClient._request (/node_modules/@prisma/client/runtime/index.js:31812:16)
[0]     at async upsertNotAvailable (file:/index.js:313:3) {
[0]   clientVersion: '4.4.0'
[0] }
[0]
[0] Node.js v18.11.0
feedback appreciated thanks
n
Hello @Ridhwaan Shakeel 👋 If you change the order and invoke
upsertManyB
before
upsertManyA
does it still timeout at
upsertManyB
invocation or there's a change in behaviour? I want to see if the main issue lies in the
upsertManyB
invocation.
r
hi @Nurul yes, I changed the order and ran
upsertManyB
first, also tried running
upsertManyC
first. Both times it is the same error. I put print statements to debug but nothing was printed Some of the changes i did: put
"type": "module",
in
package.json
changed
const { PrismaClient } = require('@prisma/client');
->
import { PrismaClient } from '@prisma/client'
v
👋 Hello @Ridhwaan Shakeel - this is just to let us know if we haven't forgotten about this. @Nurul is still actively working on this and we'll get back to you asap. Thank you for your patience! 🙏 😊