with nextjs i have same problem , and i solved it by importing the package as the following : ,
import { jwtDecode} from 'jwt-decode';
and then you can decode you token normal :
jwtDecode('your access token')