Next.js Discord

Discord Forum

How can I fix this error when I building project

Unanswered
MyMy posted this in #help-forum
Open in Discord
Property 'toSpliced' does not exist on type. Did you mean 'splice'?

When I building product it show me this. How can I fix this error

23 Replies

Yacare Caiman
do you have this uploaded on github ??
yeah I have
but it private repo
Yacare Caiman
oh ok keep it that way then
try putting the dndImg?.toSpliced() that we talked about and run build
maybe it works
Property 'toSpliced' does not exist on type '{ image: string; index: number; }[]'. Did you mean 'splice'?

  148 |     // );
  149 |     // setDndImg(dndCopy);
> 150 |     const itemsAfter = dndImg?.toSpliced(index, 1);
still er
I think the problem is lib in ts.config
"lib": [
"dom",
"dom.iterable",
"esnext",
"es2023"
],
here's my lib
But how strange I still get that err
no
I'm using 20.3.1
Try installing newest versions of types/node and typescript
If not working, try newest beta versions if available
ok I'll try that
Yes, it will only be available in typescript 5.2
Well
So i guess I will change it back to splice
Thank you guys