-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
JSON Server Not Loading with 700 MB JSON File #529
Comments
Hey @typicode , We are stuck here . Please help |
Hi, Sorry for delay. 700MB is quite big for a JSON file and Node I would try reducing the size of the file by removing all the data that you don't need to be mocked. const fs = require('fs')
const string = fs.readFileSync('db.json', 'utf-8')
JSON.parse(string) You may want to try passing options to Node to increase some of the limits (not sure it would solve everything though) |
May I ask if this is resolved? We are facing the same problem too. |
We are using requests.js, one response is pretty large. |
any updates regrading this issue? |
Hi All,
We have a JSON File which is around 700 MB.
We are trying to restart JSON Server with watching this file.
An error is thrown as below
buffer.js:496
throw new Error(‘“toString()” failed’);
^
Error: “toString()” failed
at Buffer.toString (buffer.js:496:11)
at Object.fs.readFileSync (fs.js:553:33)
at Object.read (/usr/local/lib/node_modules/json-server/node_modules/lowdb/lib/file-sync.js:15:21)
at LodashWrapper.db.read (/usr/local/lib/node_modules/json-server/node_modules/lowdb/lib/_index.js:36:29)
at module.exports (/usr/local/lib/node_modules/json-server/node_modules/lowdb/lib/_index.js:96:15)
at low (/usr/local/lib/node_modules/json-server/node_modules/lowdb/lib/index.node.js:12:10)
at module.exports (/usr/local/lib/node_modules/json-server/lib/cli/utils/load.js:36:17)
at start (/usr/local/lib/node_modules/json-server/lib/cli/run.js:119:5)
at module.exports (/usr/local/lib/node_modules/json-server/lib/cli/run.js:156:3)
at module.exports (/usr/local/lib/node_modules/json-server/lib/cli/index.js:76:3)
The text was updated successfully, but these errors were encountered: