g45t345rt/minifaker

Module "generate-password/src/generate" has no default export

themetalfleece opened this issue · 2 comments

Hey there! First of all nice job on this package :)

I've encountered the following issue:
When I'm importing this:

import { name } from 'minifaker';
import 'minifaker/dist/locales/en';

I get the following:

node_modules/minifaker/dist/index.d.ts:4:8 - error TS1192: Module '"C:/app/node_modules/generate-password/src/generate"' has no default export.

4 import _generatePassword from 'generate-password';

In node_modules/minifaker/dist/index.d.ts:4:8 if I change import _generatePassword from 'generate-password'; to import * as _generatePassword from 'generate-password';, it works as intended.

My tsconfig.json:

{
    "compilerOptions": {
        "module": "commonjs",
        "moduleResolution": "node",
        "pretty": true,
        "resolveJsonModule": true,
        "sourceMap": true,
        "target": "es2021",
        "outDir": "./dist",
        "baseUrl": "./src",
        "experimentalDecorators": true,
        "strict": true
    },
    "include": ["src/**/*.ts"],
    "exclude": ["node_modules"]
}

Thanks for reporting! Should be fixed.
What was the version of generate-password in your package.json?

It is indeed fixed, thanks! minifaker was installing generate-password 1.7.0.