terraform-cdk icon indicating copy to clipboard operation
terraform-cdk copied to clipboard

hcl2cdk: produces incorrect typescript with mix of quoted and unquoted values

Open sentry-io[bot] opened this issue 1 year ago • 3 comments

Sentry Issue: CDKTF-REGISTRY-DOCS-1A0

SyntaxError: Unexpected token, expected "," (45:32)
  43 |       "destination": "s3",
  44 |       "lifecycle": {
> 45 |         "ignoreChanges": [tags_"logDeliveryEnabled"]
     |                                ^
  46 |       },
  47 |       "name": "terraform-k...
  File "/__t/node/18.16.0/x64/lib/node_modules/cdktf-registry-docs/node_modules/prettier/parser-babel.js", line 22, in p
    '{snip} eate-error.js"(l,h){"use strict";U();function p(d,x){let P=new SyntaxError(d+" ("+x.start.line+":"+x.start.column+")");return P.loc=x,P}h.ex {snip}
  File "/__t/node/18.16.0/x64/lib/node_modules/cdktf-registry-docs/node_modules/prettier/parser-babel.js", line 22, in d
    '{snip} U();var p=lr();function d(x){let{message:P,loc:m}=x;return p(P.replace(/ \(.*\)/,""),{start:{line:m?m.line:0,column:m?m.column+1:0}})}h.expo {snip}
  File "/__t/node/18.16.0/x64/lib/node_modules/cdktf-registry-docs/node_modules/prettier/parser-babel.js", line 29, in Object.parse
    '{snip} sult:k,error:F}=Yf(...v.map(w=>()=>od(l,x,w)));if(!k)throw ed(F);return m.originalText=x,td(k,m)}}var ld=$e("parse",he(["jsx","flow"])),Lo=$ {snip}
  File "/__t/node/18.16.0/x64/lib/node_modules/cdktf-registry-docs/node_modules/prettier/index.js", line 7515, in Object.parse
    ast: parser.parse(text, parsersForCustomParserApi, opts)
  File "/__t/node/18.16.0/x64/lib/node_modules/cdktf-registry-docs/node_modules/prettier/index.js", line 8829, in coreFormat
    } = parser.parse(originalText, opts);
...
(5 additional frame(s) were not displayed)

sentry-io[bot] avatar Jun 01 '23 14:06 sentry-io[bot]

Sentry issue: CDKTF-REGISTRY-DOCS-108

sentry-io[bot] avatar Jun 01 '23 14:06 sentry-io[bot]

Sentry issue: CDKTF-REGISTRY-DOCS-10B

sentry-io[bot] avatar Jun 01 '23 14:06 sentry-io[bot]

Source:


  lifecycle {
    ignore_changes = [
      tags["LogDeliveryEnabled"],
    ]
  }

Seems like we can't deal with this kind of syntax right now.

mutahhir avatar Jun 13 '23 11:06 mutahhir