mdittmer / mdn-confluence

2 stars 5 forks source link

Generating interfaces throws an error #27

Closed connorshea closed 5 years ago

connorshea commented 6 years ago

I ran the following commands:

The last command errored for me:

connorshea$ npm run generate -- --interfaces=HTMLDocument

> mdn-confluence@0.0.7 generate /Users/connorshea/Programming/mdn-confluence
> node ./main/generate.es6.js "--interfaces=HTMLDocument"

core boot time:  23
Unknown property foam.core.Class.javaInfoType: foam.core.AbstractObjectPropertyInfo
Unknown property foam.core.Property.javaInfoType: foam.core.AbstractObjectPropertyInfo
Change of Axiom org.chromium.apis.web.LocalJsonDAO.error type from foam.core.Method to foam.core.Import
Import "error" already exists in ancestor class of org.chromium.apis.web.LocalJsonDAO.
Change of Axiom org.chromium.apis.web.HttpJsonDAO.error type from foam.core.Method to foam.core.Import
Import "error" already exists in ancestor class of org.chromium.apis.web.HttpJsonDAO.
Unknown property foam.core.Function.returns: String
Unknown property foam.core.Function.args: opt_gcloudProjectId
Unknown property foam.core.Function.returns: String
Unknown property foam.core.Function.args: classId,opt_gcloudProjectId
Unknown property foam.core.Function.returns: String
Unknown property foam.core.Function.args: classId,opt_gcloudProjectId
Unknown property foam.core.Function.returns: String
Unknown property foam.core.Function.args: classId,opt_gcloudProjectId
Unknown property foam.core.Function.returns: String
Unknown property foam.core.Function.args: classId,opt_gcloudProjectId
Unknown property foam.core.Function.returns: String
**** Boxes are running in UNSAFE mode.  Turn this off before you go to production!
**** Boxes are running in UNSAFE mode.  Turn this off before you go to production!
Property org.mozilla.mdn.BaseImporter.dataClass_ "value" hidden by "getter"
Change of Axiom org.chromium.apis.web.SerializableIndexedDAO.delegate type from foam.core.Proxy to foam.dao.DAOProperty
Unsupported change of property type fromfoam.core.Proxytofoam.dao.DAOProperty
org.chromium.apis.web.HttpJsonDAO of org.chromium.apis.web.Release created from https://storage.googleapis.com/web-api-confluence-data-cache/latest/json/org.chromium.apis.web.Release.json
Promised org.chromium.apis.web.HttpJsonDAO of org.chromium.apis.web.Release from https://storage.googleapis.com/web-api-confluence-data-cache/latest/json/org.chromium.apis.web.Release.json resolved as org.chromium.apis.web.MDAO
Change of Axiom org.chromium.apis.web.GridDAO.warn type from foam.core.Method to foam.core.Import
Import "warn" already exists in ancestor class of org.chromium.apis.web.GridDAO.
org.chromium.apis.web.HttpJsonDAO of org.chromium.apis.web.GridRow created from https://storage.googleapis.com/web-api-confluence-data-cache/latest/json/org.chromium.apis.web.GridRow.json
Promised org.chromium.apis.web.HttpJsonDAO of org.chromium.apis.web.GridRow from https://storage.googleapis.com/web-api-confluence-data-cache/latest/json/org.chromium.apis.web.GridRow.json resolved as org.chromium.apis.web.MDAO
(node:34978) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: Confluence data: Boolean array mismatch
    at Console.assert (console.js:194:23)
    at Object.assert (/Users/connorshea/Programming/mdn-confluence/node_modules/foam2/src/foam/core/lib.js:82:13)
    at Object.code [as fromGridRow] (/Users/connorshea/Programming/mdn-confluence/public/lib/org/mozilla/mdn/ConfluenceClassGenerator.es6.js:66:20)
    at foam.CLASS.methods.code.Promise.all.confluenceApis.map.api (/Users/connorshea/Programming/mdn-confluence/public/lib/org/mozilla/mdn/ConfluenceImporter.es6.js:79:42)
    at Array.map (<anonymous>)
    at Object.code [as importClassAndData] (/Users/connorshea/Programming/mdn-confluence/public/lib/org/mozilla/mdn/ConfluenceImporter.es6.js:78:28)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:34978) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:34978) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I assume this line in particular is important:

(node:34978) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

Version info:

This seems to happen in NodeJS v9.11.2 (not a typo, for some reason I happen to have both 8.11.2 and 9.11.2) as well. It also doesn't seem to matter what interfaces I pass to it.

mdittmer commented 6 years ago

Thanks for filing! It looks like the most recent data push for Confluence didn't properly update a data blob that's used by mdn-confluence. (Didn't get caught, in part, because confluence itself doesn't use that particular data model anymore.)

Anyway, I pushed new GridRow data so this should be fixed. @connorshea please confirm. Fix should be locked in to confluence data publishing workflow by https://github.com/GoogleChromeLabs/confluence/pull/319.

connorshea commented 6 years ago

👍 It looks like this fixes the problem for me, thanks!