Read: https://github.com/solana-foundation/anchor/pull/3663
Essentially, use/upgrade to Anchor version 0.31.1, Nightly version 1.88.0 then build your project with the IDL and then use nightly to generate the IDL(.json & .ts files)