-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Named range tuple incompatible with JSII compilation #393
Comments
What's the TypeScript version you're using this with? Named tuples were introduced in its version 4.0 (released in August 2020), so if you're on an earlier version, upgrading to 4.x might fix the issue. |
Hi @eemeli - We facing the same issue, also within a AWS Pipeline. Based on my 1st cross-check, we are using a current version of TypeScript. I assume it's related to JSII itself: Seems that JSII is not able to "transform" this new tuple impl. Currently we pinned yaml package to 2.0.1 to workaround this issue - This idea doesn't seems a smart idea. |
@xXPOLYGONXx @rgoltz Please see if |
@eemeli excuse the late reply. We are using Typescript "^4.6.3" so it should be new enough. |
Great! Sounds like this is solved, at least for now. I've realized through this exercise that it's not clear at all what an appropriate minimum expected TypeScript level is. The So I think the "official" line here will be to not explicitly promise any explicit level of TS version compatibility for |
Describe the bug
I am using the yaml package as a dev dependency in a JSII Project. Since the implementation of #385 there are errors when trying to compile the project which clearly point to the changes made in named pull request:
[2022-05-18T15:14:02.582] [ERROR] jsii/compiler - Compilation errors prevented the JSII assembly from being created
148 | node_modules/yaml/dist/nodes/Node.d.ts:15:30 - error TS2304: Cannot find name 'start'.
149 |
150 | 15 export declare type Range = [start: number, valueEnd: number, nodeEnd: number];
151 | ~~~~~
152 | node_modules/yaml/dist/nodes/Node.d.ts:15:35 - error TS1005: ',' expected.
153 |
154 | 15 export declare type Range = [start: number, valueEnd: number, nodeEnd: number];
155 | ~
156 | node_modules/yaml/dist/nodes/Node.d.ts:15:45 - error TS2304: Cannot find name 'valueEnd'.
157 |
158 | 15 export declare type Range = [start: number, valueEnd: number, nodeEnd: number];
159 | ~~~~~~~~
160 | node_modules/yaml/dist/nodes/Node.d.ts:15:53 - error TS1005: ',' expected.
161 |
162 | 15 export declare type Range = [start: number, valueEnd: number, nodeEnd: number];
163 | ~
164 | node_modules/yaml/dist/nodes/Node.d.ts:15:63 - error TS2304: Cannot find name 'nodeEnd'.
165 |
166 | 15 export declare type Range = [start: number, valueEnd: number, nodeEnd: number];
167 | ~~~~~~~
168 | node_modules/yaml/dist/nodes/Node.d.ts:15:70 - error TS1005: ',' expected.
169 |
170 | 15 export declare type Range = [start: number, valueEnd: number, nodeEnd: number];
To Reproduce
Create a projen AwsCdkConstructLibrary and try to compile it with the yaml package in the devDependencies.
There might be a easier way to reproduce this issue, but thats how I stumbled on it.
Expected behaviour
It should compile without errors.
Versions (please complete the following information):
yaml
: 2.1.0Additional context
The text was updated successfully, but these errors were encountered: