« first day (3093 days earlier)      last day (1009 days later) » 

 
8 hours later…
 
4 hours later…
 
2 hours later…
3:12 PM
I'm trying to share this trivial code in a separate directory between a Node.js Backend and a Next.js Front End:

// https://nodejs.dev/learn/reading-files-with-nodejs
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse
import { readFileSync } from 'fs';
function getConfig() {
const data = readFileSync('../etc/config.json');
const theJSON = JSON.parse(data);
return theJSON;
}
export { getConfig };

Node.js backend loads it find, but React.js front end keeps barfing with this error:
 
1 message moved from JavaScript
 
3:32 PM
What a mess...
 
 
4 hours later…
8:04 PM
@ShawnEary whyd you invite me here
 
 
1 hour later…

« first day (3093 days earlier)      last day (1009 days later) »