Skip to content

Fix broken TypeScript upgrade to version 4.5 #14342

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

Closed
timvandermeij opened this issue Dec 4, 2021 · 1 comment · Fixed by #14373
Closed

Fix broken TypeScript upgrade to version 4.5 #14342

timvandermeij opened this issue Dec 4, 2021 · 1 comment · Fixed by #14373

Comments

@timvandermeij
Copy link
Contributor

The TypeScript development dependency is now pinned to version 4.4.4 because version 4.5 fails for (to us) unknown reasons since nothing really stands out in the 4.5 changelogs. @michael-yx-wu @ineiti @tamuratak Would one you perhaps be able to help out with this given your TypeScript familiarity and previous work on this?

To produce the error:

  1. Clone the current master branch.
  2. Change ~4.4.4 to ^4.5.2 in package.json
  3. Run npm install
  4. Run gulp typetest and notice the following errors:
Couldn't compile TypeScript test: build/typestest/types/src/display/annotation_layer.d.ts(4,11): error TS2304: Cannot find name 'PDFPage'.
build/typestest/types/src/display/annotation_layer.d.ts(5,15): error TS2304: Cannot find name 'PageViewport'.
build/typestest/types/src/display/annotation_layer.d.ts(6,18): error TS2304: Cannot find name 'IPDFLinkService'.
build/typestest/types/src/display/annotation_layer.d.ts(7,22): error TS2304: Cannot find name 'DownloadManager'.
build/typestest/types/src/display/annotation_layer.d.ts(22,15): error TS2304: Cannot find name 'PageViewport'.
build/typestest/types/src/display/annotation_layer.d.ts(25,11): error TS2304: Cannot find name 'PDFPage'.
build/typestest/types/src/display/annotation_layer.d.ts(26,18): error TS2304: Cannot find name 'IPDFLinkService'.
build/typestest/types/src/display/annotation_layer.d.ts(27,22): error TS2304: Cannot find name 'DownloadManager'.
build/typestest/types/src/display/api.d.ts(415,39): error TS2304: Cannot find name 'Canvas'.
build/typestest/types/src/display/xfa_layer.d.ts(20,38): error TS2304: Cannot find name 'XfaLayerParameters'.
build/typestest/types/web/annotation_layer_builder.d.ts(4,14): error TS2304: Cannot find name 'PDFPage'.
build/typestest/types/web/annotation_layer_builder.d.ts(12,18): error TS2304: Cannot find name 'IPDFLinkService'.
build/typestest/types/web/annotation_layer_builder.d.ts(13,22): error TS2304: Cannot find name 'DownloadManager'.
build/typestest/types/web/annotation_layer_builder.d.ts(17,11): error TS2304: Cannot find name 'IL10n'.
build/typestest/types/web/annotation_layer_builder.d.ts(24,39): error TS2304: Cannot find name 'Canvas'.
build/typestest/types/web/annotation_layer_builder.d.ts(50,14): error TS2304: Cannot find name 'PDFPage'.
build/typestest/types/web/annotation_layer_builder.d.ts(51,18): error TS2304: Cannot find name 'IPDFLinkService'.
build/typestest/types/web/annotation_layer_builder.d.ts(52,22): error TS2304: Cannot find name 'DownloadManager'.
build/typestest/types/web/annotation_layer_builder.d.ts(55,11): error TS2304: Cannot find name 'IL10n'.
build/typestest/types/web/annotation_layer_builder.d.ts(63,39): error TS2304: Cannot find name 'Canvas'.
build/typestest/types/web/annotation_layer_builder.d.ts(72,22): error TS2304: Cannot find name 'PageViewport'.
build/typestest/types/web/annotation_layer_builder.d.ts(97,68): error TS2304: Cannot find name 'PDFPage'.
build/typestest/types/web/annotation_layer_builder.d.ts(97,173): error TS2304: Cannot find name 'IL10n'.
build/typestest/types/web/annotation_layer_builder.d.ts(99,62): error TS2304: Cannot find name 'Canvas'.
build/typestest/types/web/base_viewer.d.ts(13,15): error TS2304: Cannot find name 'EventBus'.
build/typestest/types/web/base_viewer.d.ts(17,18): error TS2304: Cannot find name 'IPDFLinkService'.
build/typestest/types/web/base_viewer.d.ts(85,11): error TS2304: Cannot find name 'IL10n'.
build/typestest/types/web/base_viewer.d.ts(97,15): error TS2304: Cannot find name 'EventBus'.
build/typestest/types/web/base_viewer.d.ts(196,30): error TS2304: Cannot find name 'PDFDocument'.
build/typestest/types/web/base_viewer.d.ts(344,87): error TS2304: Cannot find name 'PageViewport'.
build/typestest/types/web/base_viewer.d.ts(344,154): error TS2304: Cannot find name 'EventBus'.
build/typestest/types/web/base_viewer.d.ts(350,56): error TS2304: Cannot find name 'EventBus'.
build/typestest/types/web/base_viewer.d.ts(368,68): error TS2304: Cannot find name 'PDFPage'.
build/typestest/types/web/base_viewer.d.ts(368,173): error TS2304: Cannot find name 'IL10n'.
build/typestest/types/web/base_viewer.d.ts(370,62): error TS2304: Cannot find name 'Canvas'.
build/typestest/types/web/base_viewer.d.ts(378,61): error TS2304: Cannot find name 'PDFPage'.
build/typestest/types/web/base_viewer.d.ts(383,43): error TS2304: Cannot find name 'PDFPage'.
build/typestest/types/web/interfaces.d.ts(52,68): error TS2304: Cannot find name 'PDFPage'.
build/typestest/types/web/interfaces.d.ts(54,57): error TS2304: Cannot find name 'AnnotationLayerBuilder'.
build/typestest/types/web/interfaces.d.ts(142,43): error TS2304: Cannot find name 'PDFPage'.
build/typestest/types/web/interfaces.d.ts(142,53): error TS2304: Cannot find name 'StructTreeLayerBuilder'.
build/typestest/types/web/interfaces.d.ts(157,87): error TS2304: Cannot find name 'PageViewport'.
build/typestest/types/web/interfaces.d.ts(157,154): error TS2304: Cannot find name 'EventBus'.
build/typestest/types/web/interfaces.d.ts(157,177): error TS2304: Cannot find name 'TextHighlighter'.
build/typestest/types/web/interfaces.d.ts(157,195): error TS2304: Cannot find name 'TextLayerBuilder'.
build/typestest/types/web/interfaces.d.ts(170,61): error TS2304: Cannot find name 'PDFPage'.
build/typestest/types/web/interfaces.d.ts(170,126): error TS2304: Cannot find name 'XfaLayerBuilder'.
build/typestest/types/web/interfaces.d.ts(185,27): error TS2304: Cannot find name 'RenderingStates'.
build/typestest/types/web/pdf_find_controller.d.ts(5,18): error TS2304: Cannot find name 'IPDFLinkService'.
build/typestest/types/web/pdf_find_controller.d.ts(9,15): error TS2304: Cannot find name 'EventBus'.
build/typestest/types/web/pdf_find_controller.d.ts(30,19): error TS2304: Cannot find name 'IPDFLinkService'.
build/typestest/types/web/pdf_find_controller.d.ts(31,16): error TS2304: Cannot find name 'EventBus'.
build/typestest/types/web/pdf_find_controller.d.ts(47,30): error TS2304: Cannot find name 'PDFDocumentProxy'.
build/typestest/types/web/pdf_history.d.ts(5,18): error TS2304: Cannot find name 'IPDFLinkService'.
build/typestest/types/web/pdf_history.d.ts(9,15): error TS2304: Cannot find name 'EventBus'.
build/typestest/types/web/pdf_history.d.ts(48,18): error TS2304: Cannot find name 'IPDFLinkService'.
build/typestest/types/web/pdf_history.d.ts(49,15): error TS2304: Cannot find name 'EventBus'.
build/typestest/types/web/pdf_link_service.d.ts(6,15): error TS2304: Cannot find name 'EventBus'.
build/typestest/types/web/pdf_link_service.d.ts(47,15): error TS2304: Cannot find name 'EventBus'.
build/typestest/types/web/pdf_page_view.d.ts(10,15): error TS2304: Cannot find name 'EventBus'.
build/typestest/types/web/pdf_page_view.d.ts(22,22): error TS2304: Cannot find name 'PageViewport'.
build/typestest/types/web/pdf_page_view.d.ts(28,44): error TS2304: Cannot find name 'OptionalContentConfig'.
build/typestest/types/web/pdf_page_view.d.ts(32,21): error TS2304: Cannot find name 'PDFRenderingQueue'.
build/typestest/types/web/pdf_page_view.d.ts(33,23): error TS2304: Cannot find name 'IPDFTextLayerFactory'.
build/typestest/types/web/pdf_page_view.d.ts(49,29): error TS2304: Cannot find name 'IPDFAnnotationLayerFactory'.
build/typestest/types/web/pdf_page_view.d.ts(50,22): error TS2304: Cannot find name 'IPDFXfaLayerFactory'.
build/typestest/types/web/pdf_page_view.d.ts(51,29): error TS2304: Cannot find name 'IPDFStructTreeLayerFactory'.
build/typestest/types/web/pdf_page_view.d.ts(76,11): error TS2304: Cannot find name 'IL10n'.
build/typestest/types/web/pdf_page_view.d.ts(92,15): error TS2304: Cannot find name 'PageViewport'.
build/typestest/types/web/pdf_page_view.d.ts(94,44): error TS2304: Cannot find name 'OptionalContentConfig'.
build/typestest/types/web/pdf_page_view.d.ts(101,15): error TS2304: Cannot find name 'EventBus'.
build/typestest/types/web/pdf_page_view.d.ts(102,21): error TS2304: Cannot find name 'PDFRenderingQueue'.
build/typestest/types/web/pdf_page_view.d.ts(103,23): error TS2304: Cannot find name 'IPDFTextLayerFactory'.
build/typestest/types/web/pdf_page_view.d.ts(104,29): error TS2304: Cannot find name 'IPDFAnnotationLayerFactory'.
build/typestest/types/web/pdf_page_view.d.ts(105,22): error TS2304: Cannot find name 'IPDFXfaLayerFactory'.
build/typestest/types/web/pdf_page_view.d.ts(107,29): error TS2304: Cannot find name 'IPDFStructTreeLayerFactory'.
build/typestest/types/web/pdf_rendering_queue.d.ts(16,26): error TS2304: Cannot find name 'PDFViewer'.
build/typestest/types/web/pdf_rendering_queue.d.ts(20,44): error TS2304: Cannot find name 'PDFThumbnailViewer'.
build/typestest/types/web/pdf_rendering_queue.d.ts(25,29): error TS2304: Cannot find name 'IRenderableView'.
build/typestest/types/web/pdf_rendering_queue.d.ts(45,26): error TS2304: Cannot find name 'IRenderableView'.
build/typestest/types/web/pdf_rendering_queue.d.ts(53,22): error TS2304: Cannot find name 'IRenderableView'.
build/typestest/types/web/pdf_scripting_manager.d.ts(5,15): error TS2304: Cannot find name 'EventBus'.
build/typestest/types/web/pdf_scripting_manager.d.ts(46,16): error TS2304: Cannot find name 'EventBus'.
build/typestest/types/web/struct_tree_layer_builder.d.ts(3,14): error TS2304: Cannot find name 'PDFPage'.
build/typestest/types/web/struct_tree_layer_builder.d.ts(13,43): error TS2304: Cannot find name 'PDFPage'.
build/typestest/types/web/struct_tree_layer_builder.d.ts(24,14): error TS2304: Cannot find name 'PDFPage'.
build/typestest/types/web/text_highlighter.d.ts(2,21): error TS2304: Cannot find name 'PDFFindController'.
build/typestest/types/web/text_highlighter.d.ts(6,15): error TS2304: Cannot find name 'EventBus'.
build/typestest/types/web/text_highlighter.d.ts(27,21): error TS2304: Cannot find name 'PDFFindController'.
build/typestest/types/web/text_highlighter.d.ts(29,15): error TS2304: Cannot find name 'EventBus'.
build/typestest/types/web/text_layer_builder.d.ts(10,15): error TS2304: Cannot find name 'EventBus'.
build/typestest/types/web/text_layer_builder.d.ts(18,15): error TS2304: Cannot find name 'PageViewport'.
build/typestest/types/web/text_layer_builder.d.ts(23,18): error TS2304: Cannot find name 'TextHighlighter'.
build/typestest/types/web/text_layer_builder.d.ts(43,87): error TS2304: Cannot find name 'PageViewport'.
build/typestest/types/web/text_layer_builder.d.ts(43,154): error TS2304: Cannot find name 'EventBus'.
build/typestest/types/web/text_layer_builder.d.ts(43,177): error TS2304: Cannot find name 'TextHighlighter'.
build/typestest/types/web/xfa_layer_builder.d.ts(4,14): error TS2304: Cannot find name 'PDFPage'.
build/typestest/types/web/xfa_layer_builder.d.ts(6,18): error TS2304: Cannot find name 'IPDFLinkService'.
build/typestest/types/web/xfa_layer_builder.d.ts(19,61): error TS2304: Cannot find name 'PDFPage'.
build/typestest/types/web/xfa_layer_builder.d.ts(35,14): error TS2304: Cannot find name 'PDFPage'.
build/typestest/types/web/xfa_layer_builder.d.ts(37,18): error TS2304: Cannot find name 'IPDFLinkService'.
build/typestest/types/web/xfa_layer_builder.d.ts(48,22): error TS2304: Cannot find name 'PageViewport'.

[13:35:32] 'runTypesTest' errored after 2.46 s
[13:35:32] Error: Command failed: "node_modules/.bin/tsc" -p test/types

    at ChildProcess.exithandler (node:child_process:397:12)
    at ChildProcess.emit (node:events:390:28)
    at ChildProcess.emit (node:domain:537:15)
    at maybeClose (node:internal/child_process:1062:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
    at Process.callbackTrampoline (node:internal/async_hooks:130:17)
[13:35:32] 'typestest' errored after 28 s
@tamuratak
Copy link
Contributor

Generated types have changed between both versions. It is a breaking change. It seems to be a bug. I have opened an issue on TypeScript's side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants