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

JSDOM not properly polyfilling requestAnimationFrame #6937

Closed
1 task done
BeksOmega opened this issue Mar 29, 2023 · 1 comment
Closed
1 task done

JSDOM not properly polyfilling requestAnimationFrame #6937

BeksOmega opened this issue Mar 29, 2023 · 1 comment
Labels
issue: bug Describes why the code or behaviour is wrong

Comments

@BeksOmega
Copy link
Collaborator

Check for duplicates

  • I have searched for similar issues before opening a new one.

Description

JSDOM is not properly polyfilling window.requestAnimationFrame for us. This causes problems when we are testing head-ful code in a headless environment (i.e. node).

Note that it will not break headless mode (because headless mode doesn't hit this code). It only breaks headful mode when running in node, which we do for some unit tests (e.g. in samples).

Reproduction steps

  1. Revert the shim of requestAnimationFrame I added in chore: shareable release prep blockly-samples#1643
  2. Run the tests for the shareable procedures plugin using npm run test
  3. Observe the errors

Stack trace

TypeError: window.requestAnimationFrame is not a function
      at queueRender$$module$build$src$core$render_management (webpack-internal:///./node_modules/blockly/blockly_compressed.js:334:398)
      at BlockSvg$$module$build$src$core$block_svg.queueRender (webpack-internal:///./node_modules/blockly/blockly_compressed.js:925:534)
      at BlockSvg$$module$build$src$core$block_svg.removeInput (webpack-internal:///./node_modules/blockly/blockly_compressed.js:920:349)
      at BlockSvg$$module$build$src$core$block_svg.deleteAllArgInputs_ (webpack-internal:///./src/blocks.ts:911:18)
      at BlockSvg$$module$build$src$core$block_svg.updateParameters_ (webpack-internal:///./src/blocks.ts:888:14)
      at BlockSvg$$module$build$src$core$block_svg.doProcedureUpdate (webpack-internal:///./src/blocks.ts:856:14)
      at BlockSvg$$module$build$src$core$block_svg.initBlockWithProcedureModel_ (webpack-internal:///./src/blocks.ts:841:14)
      at BlockSvg$$module$build$src$core$block_svg.onchange (webpack-internal:///./src/blocks.ts:1012:14)
      at WorkspaceSvg$$module$build$src$core$workspace_svg.fireChangeListener (webpack-internal:///./node_modules/blockly/blockly_compressed.js:1308:330)
      at fireNow$$module$build$src$core$events$utils (webpack-internal:///./node_modules/blockly/blockly_compressed.js:80:342)

Screenshots

N/A

Browsers

No response

@BeksOmega BeksOmega added issue: bug Describes why the code or behaviour is wrong issue: triage Issues awaiting triage by a Blockly team member labels Mar 29, 2023
@rachel-fenichel rachel-fenichel removed the issue: triage Issues awaiting triage by a Blockly team member label Apr 5, 2023
@BeksOmega
Copy link
Collaborator Author

Believe this is closed by google/blockly-samples#1998 Correct me if I'm wrong @alicialics !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Describes why the code or behaviour is wrong
Projects
None yet
Development

No branches or pull requests

2 participants