Closed rsbmkJ closed 1 year ago
I already have the solution!!
Instead of importing like this import ow from "ow"
import this import ow from "ow/dist"
When importing the library as indicated in my previous comment, then I get this error
See: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c Especially, the TS section.
@sindresorhus please add the lines below to your package.json
files for backwards compatibility with TS projects using "type": "module"
in package.json
and "moduleResolution": "Node"
in tsconfig.json
.
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
It also gracefully resolves this issue and I believe has no side effects.
I consider it closed, yet this may change your mind: https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-main-and-types
In my React typescript project always I have this error .