Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs package not working when i switch between pages #10032

Closed
pirtpal-rwit opened this issue Nov 9, 2021 · 2 comments
Closed

fs package not working when i switch between pages #10032

pirtpal-rwit opened this issue Nov 9, 2021 · 2 comments

Comments

@pirtpal-rwit
Copy link

https://www.npmjs.com/package/fs/

I want to save my API data in JSON file

const fs = require('fs');
if(fs.writeFileSync){
  fs.writeFileSync('home.txt', 'data') 
}

on page load, it works fine, but when I switch between page it's not work fs showing empty

I want to store all my API data in folder to use as cache

@silvesterwali
Copy link
Contributor

hi @pirtpal-rwit i think fs not working in browser .
please follow this related topic vuejs-templates/webpack#262 (comment)

@stale
Copy link

stale bot commented Apr 17, 2022

Thanks for your contribution to Nuxt!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of nuxt-edge
  2. Comment the steps to reproduce it

Issues that are labeled as pending will not be automatically marked as stale.

@stale stale bot added the stale label Apr 17, 2022
@stale stale bot closed this as completed Apr 28, 2022
@danielroe danielroe added the 2.x label Jan 18, 2023
@danielroe danielroe mentioned this issue Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants