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

Uncaught Error: TypeError: fs.readdirSync is not a function #139

Closed
jEnbuska opened this issue Jun 11, 2019 · 5 comments · Fixed by #707
Closed

Uncaught Error: TypeError: fs.readdirSync is not a function #139

jEnbuska opened this issue Jun 11, 2019 · 5 comments · Fixed by #707
Labels
kind: support Asking for support with something or a specific use case solution: workaround available There is a workaround available for this issue topic: TS Paths Aliases Related to using aliases with TypeScript paths

Comments

@jEnbuska
Copy link

jEnbuska commented Jun 11, 2019

Issue type

Bug

Current Behavior

Project and example app builds when using 'npm start' & 'npm run build'
The page of examples app's content won't load.
The next error message is shown in browsers development tools:


 Uncaught Error: TypeError: fs.readdirSync is not a function
    
    at tryReaddir (react-dom.development.js:21278)
    
    at exportDirs (react-dom.development.js:21278)
    
    at Object.parcelRequire.../node_modules/utils/lib/index.js.export-dirs (react-dom.development.js:21278)

    at newRequire (Todo.tsx:24)

    at localRequire (index.js:49)

    at Object.parcelRequire.../node_modules/utils/index.js../lib (react-dom.development.js:21278)

    at newRequire (Todo.tsx:24)

    at localRequire (index.js:49)

    at Object.parcelRequire.../dist/use-classname.es.production.js.react (react-dom.development.js:21278)

    at newRequire (Todo.tsx:24)

Additional context

Example repo:
https://github.com/jEnbuska/use-classname

Your environment

Node 10.13.0

Software Version(s)
npm 6.9.0
Operating System MacOS 10.14.5
 Browesers Latest Chrome, Safari, Firefox
@swyxio
Copy link
Collaborator

swyxio commented Jun 11, 2019

this error isn't very helpful. can you try to trace further up to see the root cause of the error?

@jEnbuska
Copy link
Author

jEnbuska commented Jun 11, 2019

This is unfortunately the whole error message.
Screenshot 2019-06-11 at 11 34 28

(The err message seems to look a bit different after npm i)

@jEnbuska
Copy link
Author

jEnbuska commented Jun 11, 2019

I also have an issue with "./utils" & "./hooks" imports inside src, that cause 'npm ci' to randomply fail. Donno if this could be related?

@jEnbuska
Copy link
Author

I had a bug in my own code. I was importing 'utils' instead of './utils' and that was causing the issue.
Thanks for the help and sorry for the trouble!

@agilgur5 agilgur5 added kind: support Asking for support with something or a specific use case topic: TS Paths Aliases Related to using aliases with TypeScript paths labels Mar 19, 2020
@agilgur5
Copy link
Collaborator

agilgur5 commented Mar 19, 2020

Not really sure what readdirSync had to do with it, but see #91 regarding absolute imports being treated as externals.

@agilgur5 agilgur5 added this to the v0.13.x milestone May 3, 2020
@agilgur5 agilgur5 linked a pull request May 3, 2020 that will close this issue
@agilgur5 agilgur5 added the solution: workaround available There is a workaround available for this issue label Aug 25, 2020
Repository owner locked as resolved and limited conversation to collaborators Aug 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind: support Asking for support with something or a specific use case solution: workaround available There is a workaround available for this issue topic: TS Paths Aliases Related to using aliases with TypeScript paths
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants