Closed sergeyblohin closed 3 years ago
// @mmkal
My changes in #194 went in as v0.21.0 (i.e. after this started happening).
@sergeyblohin Likely you just need to update for the breaking change in the import style: https://github.com/sindresorhus/ow/releases/tag/v0.20.0
CommonJS users needs to change their import:
-const ow = require('ow')
+const {default: ow} = require('ow')
@mmkal, Thank you!
After changing require method from const ow
to const {default: ow}
, everything worked.
@sindresorhus This is also the case when using import ow from "ow"
, at least for me. I use Node.js 15, the newest version of ow and have a "type": "module"
in my package.json. The imported package still is an object with default
on it instead of the ow function directly. Please reopen this.
EDIT: All this when running my test code through node itself by node index.js
though. This issue probably disappears when using rollup or something else for custom module resolution.
I made a fork here btw, converting the whole project to js: https://github.com/pumpncode/ow
With this I can import normally again. I also created a PR: #207
Thoughts @sindresorhus?
Justification Method ow.object.exactShape does not work in ow versions higher than 0.19.0
Steps for reproduce Install ow version 0.20.0 or 0.21.0
Code for reproduce
But, if I use ow version 0.19.0, then all work correctly. What I do wrong?