TypeError: spawn_async_1.default is not a function
ffflorian opened this issue · 8 comments
When I import spawnAsync
in TypeScript like this:
import spawnAsync from '@expo/spawn-async';
// spawnAsync( ... )
And try running it, I get the error
TypeError: spawn_async_1.default is not a function
Try setting allowSyntheticDefaultImports
in your TypeScript configuration. This allows TS to import from CJS modules too.
I added a test here to ensure that there isn't a regression: 5cb842f. If you would like to figure out a way to address your issue without allowSyntheticDefaultImports
, please make sure the tests continue to pass (although I'm not sure it is possible).
Try setting
allowSyntheticDefaultImports
in your TypeScript configuration. This allows TS to import from CJS modules too.
Alright, thanks!
In general I think it's easier to just export it as an object instead of using a default export and CJS hacks. But that's a different story 🙂
I have allowSyntheticDefaultImports
set in my tsconfig.json
and I still get the same error.
Same here, could we re-open the issue?
Hi, any updates here ?