yeoman / configstore

Easily load and persist config without having to think about where and how
BSD 2-Clause "Simplified" License
868 stars 57 forks source link

in v6.0.0 with typescript, giving error regarding dynamic import #82

Closed MananDesai54 closed 2 years ago

MananDesai54 commented 2 years ago

configstore version: 6.0.0 nodejs version: 16.13.0 typescript version: 4.5.2

Error:
require() of ES Module /path/node_modules/configstore/index.js from /path/dist/lib/Key.js not supported.
Instead change the require of index.js in /path/dist/lib/Key.js to a dynamic import() which is available in all CommonJS modules.

I tried changing module and target in tsconfig and added type="module" in package.json but it didin't help

sindresorhus commented 2 years ago

https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

MananDesai54 commented 2 years ago

https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

Working fine now, Thank you!!