0

I'm trying to load a "local" file in a stackblitz project and I'm getting the following error

Error: ENOENT: No such file or directory., '/~/small.flb'

from this code

fs.readFile(__dirname + "/small.flb", function(err, data) {
  if (err) {
    throw err;
  }
  console.log(data.toString());
});

It seems like it has something to do with the virtualization, if you check the console in this Stackblitz you'll see the small.flb is not listed (note ./small.flb doesn't work either w/o __dirname)

1 Answer 1

0

I could be wrong, but people say that the ability has been stubbed out by FB, citing security...

I will note the behavior on StackBlitz was much different than a create-react-app local implementation, which seem to choke at webpack

I was only trying to set up a testing bed for react/node binary file reads, so I just ended up running a local copy of ERB

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.