Skip to content

Commit

Permalink
fix(eks): remove 'const' from NodeType enum
Browse files Browse the repository at this point in the history
'const enums' are inlined at the usage site by TypeScript and so the
generated type will not be in the JavaScript source code in the
assembly, even though the declaration will be there.

This leads to "symbol not found" errors upon trying to load it.

https://www.typescriptlang.org/docs/handbook/enums.html#const-enums

Fixes #1969
  • Loading branch information
Rico Huijbers committed Mar 7, 2019
1 parent 82d1862 commit 4d4c87d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-eks/lib/ami.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const LATEST_KUBERNETES_VERSION = '1.11';
/**
* Whether the worker nodes should support GPU or just normal instances
*/
export const enum NodeType {
export enum NodeType {
/**
* Normal instances
*/
Expand Down Expand Up @@ -121,4 +121,4 @@ function parseTable(contents: string): {[type: string]: {[region: string]: strin
[NodeType.GPU]: gpuTable,
[NodeType.Normal]: normalTable
};
}
}

0 comments on commit 4d4c87d

Please sign in to comment.