Closed Rigellute closed 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
?
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?
@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.
I do indeed! Basically just when the inline require
was flipped to import
https://github.com/FormidableLabs/urql-devtools/pull/296
Turns out that using
import
from electron causes the errorwhen running
yarn cosmos
.Fix is to use
require
instead ofimport
.