faker-js / faker

Generate massive amounts of fake data in the browser and node.js
https://fakerjs.dev
Other
12.65k stars 911 forks source link

[9.0.0] Locale imports are not resoved when using NodeNext in tsconfig #3105

Closed sbaechler closed 1 month ago

sbaechler commented 1 month ago

Pre-Checks

Describe the bug

When I use Faker in a Typescript project that has "module" and "moduleResolution" set to "NodeNext", the locale files cannot be resolved.

Bildschirmfoto 2024-09-11 um 15 32 00

This only happens if the module resolution is set to NodeNext, but this is the recommended setting going forward.

There is currently a workaround by using a .mjs file for the import of the Faker modules.

Minimal reproduction code

No response

Additional Context

No response

Environment Info

System:
    OS: macOS 14.6.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 5.37 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.4.1 - ~/.nvm/versions/node/v22.4.1/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v22.4.1/bin/yarn
    npm: 10.8.3 - ~/projects/gvz/mock-data/node_modules/.bin/npm
    pnpm: 8.15.4 - ~/Library/pnpm/pnpm
    bun: 1.0.29 - ~/.bun/bin/bun
  Browsers:
    Brave Browser: 128.1.69.162
    Edge: 128.0.2739.67
    Safari: 17.6
  npmPackages:
    @faker-js/faker: ^9.0.0 => 9.0.0

Which module system do you use?

Used Package Manager

npm

Shinigami92 commented 1 month ago
image

are you really sure about this?! 🤪 maybe have another look...

xDivisionByZerox commented 1 month ago

Closing this as duplicate as #3087. If you think this is a mistake, feel free to reopen this issue.