Uncaught Error: Configuration must contain `projectId`

I have my project id in .env and here is the code, Idk why its not working.

export const client = sanityClient({
    projectId: process.env.PROJECT_ID, 
    dataset: 'production',
    apiVersion: '2021-11-16',
    useCdn: true,
    token: process.env.API_TOKEN,
    
});