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

Global Typescript enum not defined #772

Closed
GabrielPerico opened this issue Apr 25, 2022 · 8 comments
Closed

Global Typescript enum not defined #772

GabrielPerico opened this issue Apr 25, 2022 · 8 comments
Assignees

Comments

@GabrielPerico
Copy link

Issue description or question

Typescript not recognising a d.ts const enum declaration

Typescript d.ts declaration:
image

Typescript file:
image

Code editor version

Visual Studio Code v1.67.0-insiders

OS name and version

Windows 10

@ArtemGovorov
Copy link
Member

Can you please share your project's tsconfig.json file?

@GabrielPerico
Copy link
Author

GabrielPerico commented Apr 26, 2022

{
	"compilerOptions": {
		"target": "ES2020",
		"module": "CommonJS",
		"rootDir": "./",
		"outDir": "./build",
		"baseUrl": "./",
		"strict": true,
		"esModuleInterop": true,
		"skipLibCheck": true,
		"forceConsistentCasingInFileNames": true,
		"paths": {
			"@MyFunctions/*": ["./Modules/Common/Functions/*", "./Modules/Common/Functions/Index.ts"],
			"@CommonTypes": ["./Modules/Common/GlobalTypes.ts"],
			"@Classes/*": ["./Modules/Common/Classes/*"]
		},
		"typeRoots": ["./node_modules/@types", "./Modules/Common/CustomTypes/CustomTypes.Type.d.ts", "./TypeOverride.d.ts"],
		"keyofStringsOnly": true
	},
	"exclude": ["node_modules", "**/node_modules/*", "Templates/*"],
	"ts-node": {
		"files": true
	}
}

@NikGovorov
Copy link
Member

NikGovorov commented Apr 27, 2022

Thanks for providing the detailed set of steps to reproduce the problem. We were able to duplicate the problem and have released a new version of Quokka for VS Code that fixes the problem (v1.0.461).

@GabrielPerico
Copy link
Author

GabrielPerico commented Apr 27, 2022

I think this is still happening, I don't know if i need some configuration that I'm not aware of or something like this.

I tried using VSCode on stable version and on Insiders and both are showing the same error on Quokka v1.0.462.

image

@NikGovorov
Copy link
Member

Is Teste const enum declared in ./TypeOverride.d.ts or in ./Modules/Common/CustomTypes/CustomTypes.Type.d.ts?

@NikGovorov NikGovorov reopened this Apr 28, 2022
@NikGovorov
Copy link
Member

Could you please also try to run test.ts here?

@GabrielPerico
Copy link
Author

GabrielPerico commented Apr 28, 2022

I tried running the test.ts and worked, I saw the differences on the tsconfig.json of my project and the repository, so after adding the noLib: false, noResolve: false and isolatedModules: false it worked.

@NikGovorov
Copy link
Member

Yes, isolatedModules does not support const enums.

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