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

React Error : TypeError: fs.existsSync is not a function #41

Open
rlembo06 opened this issue Nov 17, 2018 · 2 comments
Open

React Error : TypeError: fs.existsSync is not a function #41

rlembo06 opened this issue Nov 17, 2018 · 2 comments

Comments

@rlembo06
Copy link

rlembo06 commented Nov 17, 2018

Hi, when import your package on React project, i receive this error
capture du 2018-11-17 14-07-57

@rwjblue
Copy link
Owner

rwjblue commented Dec 12, 2018

Hey @rlembo06, thanks for opening an issue! This library requires access to the filesystem which wouldn't normally be available in the browser like this. The specific error is likely due to the fs shim not being able to cover all aspects of fs (since its running in browser).

Maybe you could describe what you are trying to do?

@larrym
Copy link

larrym commented Jun 21, 2019

I have the same issue. I am trying to embed git info in a React module. I used create-react-app to begin this project.

const someModule = () => {
   ...
      <h5>{gitInfo()}</h5>
   ...
    const gitInfo = () => {
      const info = getRepoInfo();
      return `${info.tag}-${info.abbreviatedSha}-${info.authorDate}`;
    };
}

export default someModule;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants