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

Microsoft Typescript type declarations broken #61096

Open
nhhockeyplayer opened this issue Feb 1, 2025 · 2 comments
Open

Microsoft Typescript type declarations broken #61096

nhhockeyplayer opened this issue Feb 1, 2025 · 2 comments

Comments

@nhhockeyplayer
Copy link

nhhockeyplayer commented Feb 1, 2025

🔎 Search Terms

Microsoft Typescript type declarations broken

🕗 Version & Regression Information

libs/shared/util/models/src/lib/pojo/interfaces/i-question.pojo.ts:7:18 - error TS2749: 'EMeasurement' refers to a value, but is being used as a type here. Did you mean 'typeof EMeasurement'?

7     measurement: EMeasurement;
                   ~~~~~~~~~~~~

    at compileSourceFiles (/Users/meanstack02/meanstack/node_modules/ng-packagr/lib/ngc/compile-source-files.js:175:15)
    at async /Users/meanstack02/meanstack/node_modules/ng-packagr/lib/ng-package/entry-point/compile-ngc.transform.js:80:13
    at async /Users/meanstack02/meanstack/node_modules/ng-packagr/lib/graph/transform.js:6:29

⏯ Playground Link

No response

💻 Code

export enum EMeasurement {
    Energy = 'Energy',
    Food = 'Food',
    Addiction = 'Addiction',
    Allergy = 'Allergy',
    Emotions = 'Emotions',
    Health = 'Health',
    Relationships = 'Relationships',
}

measurement: EMeasurement;

🙁 Actual behavior

trying to build my code

typescript will not compile code thats been legit for many years

🙂 Expected behavior

code should compile

Additional information about the issue

I refuse to change my declaratuions from
measurement: EMeasurement;
to
measurement: typeof EMeasurement;

the impact is catastrophic

who is instrumenting and doing this to typescript now?

what can be done to stop this nonsense

@nhhockeyplayer
Copy link
Author

meanstack02@admin meanstack % nx report

 NX   Report complete - copy this into the issue template

Node           : 22.9.0
OS             : darwin-x64
Native Target  : x86_64-macos
yarn           : 1.22.22

nx (global)            : 20.4.0
nx                     : 20.4.0
@nx/js                 : 20.4.0
@nx/jest               : 20.4.0
@nx/eslint             : 20.4.0
@nx/workspace          : 20.4.0
@nx/angular            : 20.4.0
@nx/cypress            : 20.4.0
@nx/devkit             : 20.4.0
@nx/esbuild            : 20.4.0
@nx/eslint-plugin      : 20.4.0
@nx/express            : 20.4.0
@nx/module-federation  : 20.4.0
@nx/nest               : 20.4.0
@nx/node               : 20.4.0
@nx/playwright         : 20.4.0
@nx/vite               : 20.4.0
@nx/web                : 20.4.0
@nx/webpack            : 20.4.0
nx-cloud               : 19.1.0
typescript             : 5.7.3
---------------------------------------
Registered Plugins:
@nx/cypress/plugin
@nx/eslint/plugin
---------------------------------------
Community plugins:
@compodoc/compodoc               : 1.1.26
@fortawesome/angular-fontawesome : 1.0.0
@ionic/angular                   : 6.7.5
@jsverse/transloco               : 7.5.1
@ngrx/component                  : 19.0.0
@ngrx/component-store            : 19.0.0
@ngrx/effects                    : 19.0.0
@ngrx/entity                     : 19.0.0
@ngrx/operators                  : 19.0.0
@ngrx/router-store               : 19.0.0
@ngrx/schematics                 : 19.0.1
@ngrx/store                      : 19.0.0
@ngrx/store-devtools             : 19.0.1
@nxext/capacitor                 : 20.1.0
@nxext/ionic-angular             : 20.0.5
angular-eslint                   : 19.0.2
apollo-angular                   : 8.0.1

@jcalz
Copy link
Contributor

jcalz commented Feb 1, 2025

Hmm, the code example is either pseudocode or an excerpt without necessary context, so we can't use it to reproduce or debug the issue you're having. Do you have some easy way for others to see your problem for themselves? The TypeScript Playground is one common way for people to demonstrate issues, or if you need multi-file support, the TS Bug Workbench might suffice. Or maybe you can set up a demonstration in a web IDE project of your choosing. If you can demonstrate your issue with any of these methods, providing us a link so we can see it in front of us, maybe we can help you find your problem.

If not, then the best I can offer is a guess, which is that this is caused by something other than the TypeScript language (and therefore it's out of scope here). I'd begin by looking at the place where your enum should be imported, while also trying to find exactly which parts of your build changed, possibly rolling back versions of things until you have isolated more promising leads.

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