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

DI-compiler fails to build due to change in TypeScript and @wessberg/ts-config #28

Open
cmidgley opened this issue Jun 13, 2024 · 0 comments

Comments

@cmidgley
Copy link
Contributor

In a somewhat recent release of TypeScript (I believe in some version around 5.2 but not sure) the rules for module/moduleResolution were tightened up. This causes DI-compiler to fail a build (pnpm build) with an error that module must be nodenext when moduleResolution is nodenext when using a fresh install of DI-compiler (latest TypeScript). The root cause is in @wessberg/ts-config where the following is set:

"moduleResolution": "nodenext",
"module": "esnext",

A workaround that resolves this build issue for just DI-compiler (though perhaps this is best resolved with some change to @wessberg/di-config) is to edit tsconfig.build.json and add moduleResolution: "node" to the compilerOptions:

{
	"extends": "./tsconfig.json",
	"include": [
		"src/**/*.*"
	],
	"compilerOptions": {
		"declaration": true,
		"declarationMap": false,
		"moduleResolution": "node"
	}
}
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

1 participant