question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

aws-cdk 1.134.0 / jsdom reference issue

See original GitHub issue

At some point today, when running a number of builds in a construct library that I am building, I started receiving a number of issues referring to jsdom / type errors (see the list below + 200 or so). I added an option to the tsconfig>compilerOptions>lib to add ‘DOM’ along wiht the default ‘es2018’ which resolved the issue for the jest/eslint, but the main compile is not updates in the tsconfig.json file and is still failing. I have tried to rebuild / clear the project from source and still getting the errors.

node_modules/@types/jsdom/base.d.ts:24:40 - error TS2304: Cannot find name 'DocumentFragment'. 24 static fragment(html: string): DocumentFragment; ~~~~~~~~~~~~~~~~ node_modules/@types/jsdom/base.d.ts:41:28 - error TS2304: Cannot find name 'Node'. 41 nodeLocation(node: Node): ElementLocation | null; ~~~~ node_modules/@types/jsdom/base.d.ts:172:19 - error TS2304: Cannot find name 'HTMLScriptElement'. 172 element?: HTMLScriptElement | HTMLLinkElement | HTMLIFrameElement | HTMLImageElement | undefined; ~~~~~~~~~~~~~~~~~ node_modules/@types/jsdom/base.d.ts:172:39 - error TS2304: Cannot find name 'HTMLLinkElement'. 172 element?: HTMLScriptElement | HTMLLinkElement | HTMLIFrameElement | HTMLImageElement | undefined;

Do you know what could be causing this reference issue to the jsdom library or a way to update the tsconfig to include the ‘DOM’ library?

Thanks Nick

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
infoservicesllc-labcommented, Nov 30, 2021

Hi, our yarn build last week all worked fine but they are all failing now with the same issue faced by nickehunt. I was actually advocating projen to my team and these errors are bit uncomfortable to see during the demos. Please suggest a fix.

0reactions
eladbcommented, Nov 30, 2021

At the moment, we don’t have a full fix, but only a workaround: https://github.com/projen/projen/issues/1264#issuecomment-982365744

Read more comments on GitHub >

github_iconTop Results From Across the Web

jsii with `projen new awscdk-construct` broken due to `@types ...
Running npx projen new awscdk-construct or running npx projen upgrade on an existing ... aws-cdk 1.134.0 / jsdom reference issue #1266.
Read more >
1.134.0 - aws-cdk - npm
aws-cdk. TypeScript icon, indicating that this package has built-in type declarations. 1.134.0 • Public • Published a year ago.
Read more >
Working with the AWS CDK - AWS Documentation
js versions 13.0.0 through 13.6.0 are not compatible with the AWS CDK due to compatibility issues with its dependencies. After installing Node.js, install...
Read more >
jsdom not loading or not running external scripts in page
I will post a minimal test case in the next day or so - but I wanted to see if anyone else had...
Read more >
Update jsdom to latest major release [#3265664] | Drupal.org
Problem /Motivation jsdom could be updated from 18.1.1 to 19.0.0. Proposed resolution Update jsdom to latest releases and backport to 9.4.x.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found