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

Cannot find type definition file for './node_modules/@lingui/macro/global'. #1869

Closed
welsea opened this issue Feb 29, 2024 · 2 comments
Closed

Comments

@welsea
Copy link

welsea commented Feb 29, 2024

Describe the bug
tsconfig.json reports an error after adding lingui in types.

To Reproduce
Follow the documentation,

  1. install packages by using:
npm install --save-dev @lingui/cli @lingui/macro babel-plugin-macros @babel/core
npm install --save @lingui/core
  1. In tsconfig,json
{
  "compilerOptions": {
    "types": ["./node_modules/@lingui/macro/global"]
  }
}

Expected behavior
tsconfig.json does not report any error.

Additional context

  "devDependencies": {
    "@babel/core": "^7.24.0",
    "@lingui/cli": "^4.7.1",
    "@lingui/macro": "^4.7.1",
    "babel-plugin-macros": "^3.1.0",
    "typescript": "^5.2.2"
  },
  "dependencies": {
    "@lingui/core": "^4.7.1",
  }

under ./node_modules/@lingui/marco there is no global

@andrii-bodnar
Copy link
Contributor

@welsea thanks for pointing this out!

The TypeScript documentation looks a bit misleading because the global.d.ts file is not being included in the distribution after the migration to unbuild (https://github.com/lingui/js-lingui/releases/tag/v4.0.0-next.4)

@thekip do we just need to include it in the files array in the package.json?

@timofei-iatsenko
Copy link
Collaborator

I wouldn't want to do that. it's been a while since 4.0 release and it doesn't seem to be used much. This solution with "global.d.ts" file was highly questionable initially i don't want to continue supporting this.
I would instead remove this from the documentation and focus on separating the macro into a js and react version

@andrii-bodnar andrii-bodnar closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants