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

Compile errors of user of @aws-crypto/material-management with TypeScript 3.7.2 #232

Closed
ankon opened this issue Nov 6, 2019 · 4 comments · Fixed by #233
Closed

Compile errors of user of @aws-crypto/material-management with TypeScript 3.7.2 #232

ankon opened this issue Nov 6, 2019 · 4 comments · Fixed by #233

Comments

@ankon
Copy link

ankon commented Nov 6, 2019

With @aws-crypto/client-node 1.0.1, TypeScript 3.7.2, on NodeJS 12.13.0 I'm getting this error when compiling our own sources:

> tsc && tsc -p tsconfig.es6.json

node_modules/@aws-crypto/material-management-node/build/main/node_cryptographic_materials_manager.d.ts:3:21 - error TS2440: Import declaration conflicts with local declaration of 'NodeEncryptionMaterial'.

3 NodeAlgorithmSuite, NodeEncryptionMaterial, NodeDecryptionMaterial, KeyringNode, GetEncryptionMaterials, GetDecryptMaterials } from '@aws-crypto/material-management';
                      ~~~~~~~~~~~~~~~~~~~~~~

node_modules/@aws-crypto/material-management-node/build/main/node_cryptographic_materials_manager.d.ts:3:45 - error TS2440: Import declaration conflicts with local declaration of 'NodeDecryptionMaterial'.

3 NodeAlgorithmSuite, NodeEncryptionMaterial, NodeDecryptionMaterial, KeyringNode, GetEncryptionMaterials, GetDecryptMaterials } from '@aws-crypto/material-management';
                                              ~~~~~~~~~~~~~~~~~~~~~~


Found 2 errors.

tsconfig.json:

{
	"extends": "./tsconfig.base.json",
	"compilerOptions": {
		"outDir": "dist"
	}
}

tsconfig.es6.json:

{
	"extends": "./tsconfig.base.json",
	"compilerOptions": {
		"module": "es2015",
		"outDir": "dist.es6"
	}
}

tsconfig.base.json:

{
	"extends": "tsconfig-collaborne",
	"compilerOptions": {
		"declaration": true
	},
	"include": [
		"src"
	]
}

(https://github.com/Collaborne/tsconfig-collaborne/blob/master/tsconfig.json has "tsconfig-collaborne")

@ankon
Copy link
Author

ankon commented Nov 6, 2019

Changing NodeJS to 10.16 doesn't change things.
Changing TypeScript to 3.6.4 "fixes" the compile error.

@seebees
Copy link
Contributor

seebees commented Nov 6, 2019

Thanks for the report!

seebees added a commit to seebees/aws-encryption-sdk-javascript that referenced this issue Nov 6, 2019
resolves aws#232

Typescript 3.7 does a better job identifying declaration conflicts
and so identifies the conflite between the type
and the class import of the same name.
e.g. `WebCryptoEncryptionMaterial` is defined as a type and imported.
When aws#148 was the referance to the return type
can go directly to the needed Material (WebCrypto or Node).
seebees added a commit to seebees/aws-encryption-sdk-javascript that referenced this issue Nov 6, 2019
resolves aws#232

Typescript 3.7 does a better job identifying declaration conflicts
and so identifies the conflict between the type
and the class import of the same name.
e.g. `WebCryptoEncryptionMaterial` is defined as a type and imported.
When aws#148 was the reference to the return type
can go directly to the needed Material (WebCrypto or Node).
seebees added a commit to seebees/aws-encryption-sdk-javascript that referenced this issue Nov 6, 2019
resolves aws#232

Typescript 3.7 does a better job identifying declaration conflicts
and so identifies the conflict between the type
and the class import of the same name.
e.g. `WebCryptoEncryptionMaterial` is defined as a type and imported.
When aws#148 was written the reference to the return type
should have gone directly to the needed Material (WebCrypto or Node).
seebees added a commit that referenced this issue Nov 7, 2019
resolves #232

Typescript 3.7 does a better job identifying declaration conflicts
and so identifies the conflict between the type
and the class import of the same name.
e.g. `WebCryptoEncryptionMaterial` is defined as a type and imported.
When #148 was written the reference to the return type
should have gone directly to the needed Material (WebCrypto or Node).
@ankon
Copy link
Author

ankon commented Nov 12, 2019

If I may ask, what is the rough timeline for a release of the SDK with the fix for that problem?

@seebees
Copy link
Contributor

seebees commented Nov 12, 2019

@ankon Released to npm :)

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