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

Property 'request' of exported class expression may not be private or protected.ts(4094) #15

Closed
svnty opened this issue Dec 13, 2023 · 5 comments · Fixed by #16
Closed

Comments

@svnty
Copy link
Contributor

svnty commented Dec 13, 2023

Screen Shot 2023-12-13 at 7 17 06 pm

What am I doing wrong?

Screen Shot 2023-12-13 at 7 17 50 pm

@sstur
Copy link
Owner

sstur commented Dec 13, 2023

This is strange, I've not seen this one before. And your code looks fine. What version of TS are you on? Ensure you're using the same version in VS Code and in the codebase. At the terminal you can run cat node_modules/typescript/package.json | grep version and in VS code click on the curly braces near the word "TypeScript" in the status bar.

image

If you have a minimal reproducible example that I can run on my side, that would help.

@sstur
Copy link
Owner

sstur commented Dec 13, 2023

Oh, also could you paste the contents of your tsconfig file?

According to this issue, it might be related to having "declaration emit enabled" in your config.

anonymous classes can't have private or protected members if declaration emit is enabled

@svnty
Copy link
Contributor Author

svnty commented Dec 13, 2023

"version": "5.3.3",

My source code is available here
https://github.com/medicamina/api/tree/main

{
  "compilerOptions": {
    "lib": ["ESNext"],
    "module": "esnext",
    "target": "esnext",
    "moduleResolution": "bundler",
    "moduleDetection": "force",
    "allowImportingTsExtensions": true,
    "noEmit": true,
    "composite": true,
    "strict": true,
    "downlevelIteration": true,
    "skipLibCheck": true,
    "jsx": "react-jsx",
    "allowSyntheticDefaultImports": true,
    "forceConsistentCasingInFileNames": true,
    "allowJs": true,
    "types": [
      "bun-types" // add Bun global
    ]
  }
}

@svnty
Copy link
Contributor Author

svnty commented Dec 13, 2023

What's strange is that the code compiles and runs without errors or warnings, it's just VS code complaining about types

@svnty
Copy link
Contributor Author

svnty commented Jan 2, 2024

I fixed it

The troublemaker
Screen Shot 2024-01-02 at 9 00 13 pm

The new problem
Screen Shot 2024-01-02 at 9 05 37 pm

VS Code's fix
Screen Shot 2024-01-02 at 9 05 43 pm

Source code https://github.com/svnty/nbit/blob/main/packages/core/src/core/CustomRequest.ts

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

Successfully merging a pull request may close this issue.

2 participants