Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript definition broken because of food.json #125

Closed
rothsandro opened this issue Jan 23, 2022 · 1 comment
Closed

TypeScript definition broken because of food.json #125

rothsandro opened this issue Jan 23, 2022 · 1 comment

Comments

@rothsandro
Copy link
Contributor

rothsandro commented Jan 23, 2022

Is this a regression?

Yes

Description

The TypeScript definitions are broken because of the food.json import. Food is the only function that imports the json not just for the actual function but for the type definition of CuisineOrigin.

  1. Create a new Angular 13 project with Angular CLI
  2. Install falso
  3. Import and use any of the rand* function
  4. Start the project with npm start

The error below is thrown.

Please provide a link to a minimal reproduction of the bug

https://github.com/rothsandro/falso-typescript

Please provide the exception or error you saw

Error: node_modules/@ngneat/falso/lib/food.d.ts:2:22 - error TS2732: 
Cannot find module './food.json'. Consider using '--resolveJsonModule' to import module with '.json' extension.

import { data } from './food.json';
                       ~~~~~~~~~~~~~

Please provide the environment you discovered this bug in

@ngneat/falso    2.11.0
typescript       4.5.2
node             v16.13.0

Anything else?

Workaround: set skipLibCheck in tsconfig to false

Do you want to create a pull request?

No

@maxiwer
Copy link

maxiwer commented Dec 14, 2022

I think you need to find the root cause, because this thing showed up again. What's in project:

  • @ngneat/falso: ^6.1.0
  • typescript: ^4.7.4
  • node: v14.20.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants