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.

`@sapui5/ts-types-esm` - third party types (three, jquery, qunit) should be listed as dependencies in `package.json`

See original GitHub issue

otherwise you get all these compile errors, then you have to track down the missing dependency manually:

node_modules/@sapui5/ts-types-esm/types/sap.ui.vk.d.ts:19001:19 - error TS2503: Cannot find namespace 'THREE'.

19001       parentNode: THREE.Object3D,
                        ~~~~~

node_modules/@sapui5/ts-types-esm/types/sap.ui.vk.d.ts:19010:25 - error TS2503: Cannot find namespace 'THREE'.

19010       insertBeforeNode: THREE.Object3D,
                              ~~~~~

node_modules/@sapui5/ts-types-esm/types/sap.ui.vk.d.ts:19019:8 - error TS2503: Cannot find namespace 'THREE'.

19019     ): THREE.Object3D;
             ~~~~~

node_modules/@sapui5/ts-types-esm/types/sap.ui.vk.d.ts:19210:8 - error TS2503: Cannot find namespace 'THREE'.

19210     ): THREE.Object3D[];
             ~~~~~

node_modules/@sapui5/ts-types-esm/types/sap.ui.vk.d.ts:19374:37 - error TS2503: Cannot find namespace 'THREE'.

19374       materialToReplace: Material | THREE.Material,
                                          ~~~~~

node_modules/@sapui5/ts-types-esm/types/sap.ui.vk.d.ts:19378:28 - error TS2503: Cannot find namespace 'THREE'.

19378       material: Material | THREE.Material
                                 ~~~~~

node_modules/@sapui5/ts-types-esm/types/sap.ui.vk.d.ts:19436:20 - error TS2503: Cannot find namespace 'THREE'.

19436       boundingBox: THREE.Box3
                         ~~~~~

node_modules/@sapui5/ts-types-esm/types/sap.ui.vk.d.ts:19445:20 - error TS2503: Cannot find namespace 'THREE'.

19445       boundingBox: THREE.Box3
                         ~~~~~

node_modules/@sapui5/ts-types-esm/types/sap.ui.vk.d.ts:19517:20 - error TS2503: Cannot find namespace 'THREE'.

19517       boundingBox: THREE.Box3
                         ~~~~~

node_modules/@sapui5/ts-types-esm/types/sap.ui.vk.d.ts:19563:14 - error TS2503: Cannot find namespace 'THREE'.

19563       scene: THREE.Scene
                   ~~~~~

node_modules/@sapui5/ts-types-esm/types/sap.ui.vk.d.ts:19606:20 - error TS2503: Cannot find namespace 'THREE'.

19606     getSceneRef(): THREE.Scene;
                         ~~~~~

node_modules/@sapui5/ts-types-esm/types/sap.ui.vk.d.ts:19614:17 - error TS2503: Cannot find namespace 'THREE'.

19614       nodeRefs: THREE.Object3D | THREE.Object3D[]
                      ~~~~~

node_modules/@sapui5/ts-types-esm/types/sap.ui.vk.d.ts:19614:34 - error TS2503: Cannot find namespace 'THREE'.

19614       nodeRefs: THREE.Object3D | THREE.Object3D[]
                                       ~~~~~

node_modules/@sapui5/ts-types-esm/types/sap.ui.vk.d.ts:19624:8 - error TS2503: Cannot find namespace 'THREE'.

19624     ): THREE.Object3D | THREE.Object3D[];
             ~~~~~

node_modules/@sapui5/ts-types-esm/types/sap.ui.vk.d.ts:19624:25 - error TS2503: Cannot find namespace 'THREE'.

19624     ): THREE.Object3D | THREE.Object3D[];
                              ~~~~~

node_modules/@sapui5/ts-types-esm/types/sap.ui.vk.d.ts:19959:19 - error TS2503: Cannot find namespace 'THREE'.

19959       quaternion: THREE.Quaternion,

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
akudevcommented, Feb 15, 2022

@DetachHead Not sure whether this was mentioned before, but with skipLibCheck: true you will not see these errors.

But regardless, we have decided to add the dependencies. The change has now been submitted (in an internal repo for build stuff) and will be in effect with version 1.100, as the codesplit for 1.99 has already happened.

SAPUI5 types have then the following: “dependencies”: { “@types/jquery”: “3.5.13”, “@types/qunit”: “2.5.4”, “@types/three”: “0.125.3”, “@types/offscreencanvas”: “2019.6.4” } (always the highest patch version of the closest major/minor version available) The last one is needed due to types referenced internally in THREE.js.

Thanks!

1reaction
akudevcommented, Nov 29, 2021

Hi, thanks for the suggestion! I triggered changes that add

  "dependencies": {
    "@types/jquery": "3.6.0",
    "@types/qunit": "2.3.2",
    "@types/three": "0.125.3"
}

for SAPUI5 and

  "dependencies": {
    "@types/jquery": "3.6.0",
    "@types/qunit": "2.3.2"
  }

for OpenUI5. That’s referencing the currently included version of each library, but in case of THREE.js, there are no type definitions for the currently used version r119, so I used the next higher version to ensure all potentially used APIs are covered.

That’s only ts-types-esm so far, I’ll check the legacy types later.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unifying third-party dependency management (through npm)
Take third party dependencies out of the src folders... and add them to the package.json file and running npm install.
Read more >
Conflicting jquery NPM packages - node.js - Stack Overflow
Other time my node_modules\jquery\package.json file is this, and the build breaks with missing dependencies. This appears to be the unofficial ...
Read more >
A Guide to Managing Webpack Dependencies - Toptal
In the Webpack configuration, the Entry option tells Webpack where the starting point is for the final bundle. An entry point can have...
Read more >
Third-party Dependencies - Fabricator
Fabricator makes it easy to include a third-party library like jQuery in your toolkit. Using Webpack to bundle dependencies. Fabricator uses Webpack to...
Read more >
How to include third party libraries / modules in SAPUI5
Although third party modules don't use UI5 APIs, they still can be listed as dependencies in a sap.ui.define call. They will be requested ......
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