I get this message using NextJS 14.2.5, node 20.16.0, npm 10.2.4 and chrome 127.0.6533.89 for the following component:
import fs from 'fs/promises'
export async function logging({func, id, comp}: {func: string, id: string, comp: string}) {
const filePath = 'd:\dropbox\javascript\prog\react\courses\wds\ecommerce\act\json/data.json'
let arrayData = JSON.parse((await fs.readFile(filePath)).toString('utf8'))
const result = await fs.writeFile(filePath, JSON.stringify(new Array([func, id, comp])))
}
return 'Correct'
}
The messages disappeares fater commenting the lines with fs.readFile and fs.writeFile
I have reported this also in the node community, but got the answer that th eproblem will be NextJS related.
I'm stuck so will appreciate any help for this problem.