When a Node.js module import causes the
Module … has no default export
or
Internal server error: [vite] The requested module ‘…’ does not provide an export named ‘default’
error message, change the import statement, update the function name, and enclose the function name with curly braces:
# Replace
import jwt_decode from "jwt-decode";
# with
import { jwtDecode } from "jwt-decode";
This table contains the old and new function names
Old function name | New function name |
jwt_decode | jwtDecode |