AirmanEpicA
Denoβ€’15mo agoβ€’
1 reply
AirmanEpic

Next throwing an error that seems to be "Deno not defined"

Weird issue here, but I'm probably misusing the client/server functions somewhere. Anyway, I have this function "getScores"

"use server"

import config from '../config.json' with { type: "json" };

export async function getScores(){
    let scoresPath = `${config.folder}/scores.hth`;
    let scores:{[fileName:string]:number} = {};
    try{
        let data = await Deno.readTextFile(scoresPath);
        scores = JSON.parse(data);
    }
    catch(err){
        console.log("13")
        console.error("Error in scores file: ", err)
        throw new Error("Error reading scores file");
    }
    return {scores: scores, path: config.folder};
}


and seems to perform alright the first time it's called. However, my code calls for a reload, and getScores happens after the reload. This causes the nextjs process to actually crash, which I've never seen before. The errors:
Was this page helpful?