Closed sahilsehwag closed 11 months ago
Probably related to this in the README:
fp-ts-std is published with both ESM and CJS modules. The import paths in either case needn't change and the appropriate module resolution should be picked up by Node and your bundler, however if your environment doesn't support conditional exports you'll need to import directly from a dist/(cjs|esm)/ subdirectory. Given ESM modules the library should tree shake well.
What versions of Webpack and TypeScript are you using?
webpack: 4.44.2 typescript: ^5.0.2
I may be wrong but I think only Webpack 5 supports conditional exports. You'll need to upgrade or import from the relevant subdirectory directly.
In my setup eslint is failing with the same error.
@Mati365 Is that eslint-plugin-import?: https://github.com/import-js/eslint-plugin-import/issues/1810
@samhh yep
Error:
Cannot find module 'fp-ts-std/Function' or its corresponding type declarations.
I have tried all the solutions mentioned in different comments across different issues relating to this. But I am unable to use fp-ts-std. I am using this library in a chrome extension I am building using react and webpack.