AirmanEpic
AirmanEpic
DDeno
Created by AirmanEpic on 11/5/2024 in #help
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};
}
"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:
2 replies
DDeno
Created by AirmanEpic on 11/4/2024 in #help
VSC having issues with NextJS using Deno
No description
5 replies