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 error due to missing "types" field #176

Closed
PabloSzx opened this issue Jan 16, 2022 · 0 comments · Fixed by #173
Closed

Typescript error due to missing "types" field #176

PabloSzx opened this issue Jan 16, 2022 · 0 comments · Fixed by #173
Labels
c: bug Something isn't working

Comments

@PabloSzx
Copy link

Describe the bug

Typescript gives the error:

> tsc

node_modules/.pnpm/@faker-js+faker@6.0.0-alpha.3/node_modules/@faker-js/faker/index.ts:4:1 - error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead.

4 export = faker;
  ~~~~~~~~~~~~~~~


Found 1 error.

This is fixed by adding the "types" field:

From:

{
  "name": "@faker-js/faker",
  "version": "6.0.0-alpha.3",
  "description": "Generate massive amounts of fake contextual data",
  "repository": {
    "type": "git",
    "url": "https://github.com/faker-js/faker.git"
  },
  "license": "MIT",
  "main": "index.js",
  "scripts": {}
}

To:

{
  "name": "@faker-js/faker",
  "version": "6.0.0-alpha.3",
  "description": "Generate massive amounts of fake contextual data",
  "repository": {
    "type": "git",
    "url": "https://github.com/faker-js/faker.git"
  },
  "license": "MIT",
  "main": "index.js",
  "types": "index.d.ts",
  "scripts": {}
}

Reproduction

https://github.com/pabloszx/faker-error-types

Additional Info

"@faker-js/faker": "6.0.0-alpha.3"

@PabloSzx PabloSzx added the s: pending triage Pending Triage label Jan 16, 2022
@import-brain import-brain added c: bug Something isn't working and removed s: pending triage Pending Triage labels Jan 16, 2022
@Shinigami92 Shinigami92 linked a pull request Jan 16, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants