All Questions
Tagged with node.js-fs reactjs
92 questions
0
votes
2
answers
39
views
Use npm library in React Native, when it imports fs
I understand that I cannot simply use fs in React Native as in Node. However, my situation is a bit different. Here's a simple representation of my problem.
Library:
const fs = require('fs')
function ...
0
votes
1
answer
50
views
why does it seem my variable is updating with the new data after it saves to the file? React and NWJS
I'm working on a note-taking app using React and NWJS, where notes are saved to a separate file (save.json). The app fetches initial data from this file using a useEffect hook, handles input changes ...
0
votes
1
answer
90
views
Receive file contents in React front-end application
I am having an API endpoint in my NodeJS application. I am posting a filename to it to find the specific file in a folder. I am doing it like this:
const fileDirectory = 'C:/Sites/private-uploads';
...
1
vote
0
answers
33
views
Detecting File Closure After Saving in Electron with Chokidar
Here is the code snippet
ipcMain.handle("open-dialog", async (event: Electron.IpcMainInvokeEvent) => {
let filePaths = await dialog.showOpenDialog({
properties: ["...
0
votes
0
answers
290
views
TypeError: Cannot read properties of undefined (reading 'readFile')
I am learning how to create an Electron react app and i want to use fs.readFileSync() in a renderer file (i'm trying to get it to work with the amazon rekognition api). I used contextBridge and ...
1
vote
0
answers
75
views
file pathname is not found on the production mode using fs.writeFile
i have a api route in my nextjs project and i'm using fs.writeFile method such as
await fs.writeFile( process.cwd() + '/app/data/list.json', data )
It is working properly on development and local ...
1
vote
1
answer
2k
views
i18n NextJS "FS Module not found: Can't resolve 'fs'" on component only
this is my first question here so sorry if formatting or doing anything else wrong. Here to learn.
If I run this code from index.js. The correct translation will be pulled and logged.
import React ...
4
votes
0
answers
2k
views
Error: ENOTEMPTY: directory not empty, rmdir when I use fs.rmSync on a folder with nested folders
I have a react + node website in which I have the following route to delete a folder called cache and remake it. Basically it should "clear cache".
const deleteCache = async (req, res) => ...
4
votes
0
answers
437
views
Why do @fs occur in the image path I import?
I create a script named "FileUtil.jsx" to import a bunch of images and export them to another component.
import Oolong from '../assests/img/Oolong.png'
import ChaiTea from '../assests/img/...
2
votes
1
answer
2k
views
Error: Module not found: Can't resolve 'fs' and 'path' in '@sendgrid/helpers/classes'
I'm trying to use the SendGrid module in my React application to send an email using a contact form. However, when I run npm start, I encounter the following error:
Failed to compile.
Module not found:...
0
votes
1
answer
140
views
Retrieving an image from Server to Client (Mongodb, React js, Node js)
I am storing a user's information using mongoose. (Below is a quick summary of the code in Node js)
const UserSchema = new mongoose.Schema({
username: {
type: String,
required:...
1
vote
1
answer
2k
views
Using 'fs' in Next.js doesn't return any errors but doesn't write file at same time, i can't find any solutions that works
i'm facing a problem using fs in a next.js / react app context
so i'm doing a little app for renting appartments i have a json file named database.json with some datas in it and i'm able to retrieve ...
0
votes
0
answers
29
views
Differences between 2 React node apps
I am trying to integrate 2 react apps I have been working on into 1 new react application (all created using npx create-react-app nameofapp) but I can not get the libraries I have used in the previous ...
1
vote
1
answer
842
views
Importing fs in react-native
I'm trying to import TinyDB in an expo project but I need help with fs, because expo doen't allow fs as it is a third-party file system.
I try using react-native-fs but I don´t kow how to use it. Can ...
0
votes
1
answer
1k
views
Reactjs read text file line by line using fs
With reactjs, I tried to use fs to read a text file line by line, but then the compiler complains "Module not found: Error: Can't resolve 'fs'. I browsed the internet, it's well known reactjs bug ...