question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

fs.readFileSync - Cannot statically evaluate fs argument

See original GitHub issue

๐Ÿ› bug report

๐ŸŽ› Configuration (.babelrc, package.json, cli command)

{
  "your": { "config": "here" }
}

๐Ÿค” Expected Behavior

๐Ÿ˜ฏ Current Behavior

๐Ÿ’ Possible Solution

๐Ÿ”ฆ Context

๐Ÿ’ป Code Sample

https://github.com/mytee306/marked-intro

๐ŸŒ Your Environment

Software Version(s)
Parcel latest
Node latest
npm/Yarn latest
Operating System linux mint

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:4
  • Comments:21 (6 by maintainers)

github_iconTop GitHub Comments

29reactions
codeshifucommented, Jan 4, 2020

just tell parcel youโ€™re running in a node environment with the target flag

e.g. parcel app.js --target node

1reaction
bhagyascommented, Mar 3, 2020

@codeshifu That is all it takes!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot statically evaluate fs argument? - Stack Overflow
My guess is that you have this in server-side code but accidentally have the bundler trying to bundle it. (Bundlers don't like non-static...
Read more >
@parcel/fs - npm
Start using @parcel/fs in your project by running `npm i @parcel/fs`. There are 46 other projects in the npm registry using @parcel/fs.
Read more >
Trying To Import Results In Fs.Existssync Is Not A Function
Synchronously tests whether or not the given path exists by checking with the file system. Most used fs functions. readFileSync. Synchronously reads the...
Read more >
Node.js v19.3.0 Documentation
Passing arguments and this to listeners; Asynchronous vs. synchronous; Handling events ... readFileSync(path[, options]); fs. ... error cannot be a string.
Read more >
Scripting Languages I: Node.js, Python, PHP, Ruby
read file into string, let fs = require('fs'); let s = fs.readFileSync('/etc/hosts', 'utf8');, s = f.read(), $s = file_get_contents(
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found