urql-graphql / urql-devtools

A tool for monitoring and debugging urql during development
https://formidable.com/open-source/urql/docs/advanced/debugging/#devtools
MIT License
257 stars 11 forks source link

Fix electron require #302

Closed Rigellute closed 4 years ago

Rigellute commented 4 years ago

Turns out that using import from electron causes the error

fs.existsSync is not a function

when running yarn cosmos.

Fix is to use require instead of import.

andyrichardson commented 4 years ago

@Rigellute what was the issue you were seeing before?

Electron imports are ignored when building cosmos. Maybe you had the BUILD_ENV environment variable set to electron?

wgolledge commented 4 years ago

It was TypeError: fs.existsSync is not a function happening on all cosmos instances (Netlify deploy etc). I'm guessing the ignore might still do the import but then doesn't include it?

andyrichardson commented 4 years ago

@wgolledge thanks for clearing that up! I thought it might have been a local reproduction issue.

Do we know when it was first introduced? I assume it was after a dependency update but can't source the first occurrence.

wgolledge commented 4 years ago

I do indeed! Basically just when the inline require was flipped to import https://github.com/FormidableLabs/urql-devtools/pull/296