Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JET 7 Typescript Knockout

Andrew BennettJun 6 2019 — edited Jun 6 2019

Hey Guys,

Just found an issue with JET 7.0.0 and typescript that means you cannot compile the application. Creating a new JET 7.0.0 application it installs the following packages as dependencies of @oracle/oraclejet (contents of the package-lock.json)

"@oracle/oraclejet": {

  "version": "7.0.0",

  "resolved": "[https://registry.npmjs.org/@oracle/oraclejet/-/oraclejet-7.0.0.tgz](https://registry.npmjs.org/@oracle/oraclejet/-/oraclejet-7.0.0.tgz)",

  "integrity": "sha512-r/d44kUYAHypIAoRQLu9UcLy0FxS07B78PbsUP5YEKmDq8o/Th73QuSwcLViBdGI9TXRutE2igdDuSp09JhAfw==",

  "requires": {

    "@types/geojson": "^7946.0.7",

    **"@types/knockout": "^3.4.66",**

    "@types/signals": "^1.0.1",

    "@webcomponents/custom-elements": "1.1.2",

    "es6-promise": "4.2.6",

    "hammerjs": "2.0.8",

    "jquery": "3.4.1",

    "jquery-ui": "1.12.1",

   ** "knockout": "3.5.0",**

    "proj4": "2.5.0",

    "require-css": "0.1.10",

    "requirejs": "2.3.6",

    "requirejs-text": "2.0.15",

    "signals": "1.0.0",

    "touchr": "1.0.1"

  }

},

You can see that it depends on @types/knockout version 3.4.x and further down it depends on knockout 3.5.0. This causes the type definitions for 2 different versions to be within your node_modules folder. There is a big change between the versions where it exports ko with different types, 3.4.0 exports ko as declare var ko: KnockoutStatic; declare module "knockout" { export = ko; } whereas version 3.5.0 exports ko as export as namespace ko;

When you then go to compile the typescript with tsc it throws the following error when the typescript version you have installed is 3.5.1 or later (could be others previous to this, just one I noticed it on). When I revert back to an older version of typescript such as 3.1.3 it does not throw this error and allows it to be compiled properly. I presume they have just got strict on this rule now.

pastedImage_6.png

I think the dependencies of @oracle/oraclejet needs the @types/knockout updating to version 3.5.0 otherwise there will be a lot of people coming across this issue.

Andy

This post has been answered by John JB Brock-Oracle on Jun 6 2019
Jump to Answer
Comments
Post Details
Added on Jun 6 2019
1 comment
370 views