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

HTML pipeline fails: Runtime.VDOMFactory is not a constructor #2

Closed
bdelacretaz opened this issue Jun 17, 2019 · 6 comments
Closed
Labels
bug Something isn't working

Comments

@bdelacretaz
Copy link
Collaborator

Description

I have tried publishing this repository at https://bertrand.helix-demo.xyz/ and that page says error | "Response is not valid 'message/http'

Looking at the corresponding wsk activation logs this is the error in html.pipe.js:

2019-06-17T18:11:48.733Z       stdout: error: Exception during once-#11/once:once from 
/nodejsAction/XXCcHAEO/node_modules/@adobe/helix-pipeline/src/defaults/html.pipe.js:63:
TypeError: Runtime.VDOMFactory is not a constructor
at main (/nodejsAction/XXCcHAEO/html.js:141:28)
at invoker (/nodejsAction/XXCcHAEO/html.js:194:43)
at process._tickCallback (internal/process/next_tick.js:68:7)
2019-06-17T18:11:48.734Z       stdout: debug: payload.error -> 500

A clear and concise description of what the bug is.

To Reproduce
Publishing this repository with hlx deployand hlx publish should reproduce the error, unless there's something wrong with my bertrand.helix-demo.xyz domain which I used for other tests previously.

Expected behavior
The HTML page should be published.

Version:
Both hlx 3.2.0 and the current https://github.com/adobe/helix-cli master branch cause this issue.

Additional context
None so far

@bdelacretaz bdelacretaz added the bug Something isn't working label Jun 17, 2019
@tripodsan
Copy link
Contributor

works for me:
https://www.99productrules.com/

image

$ hlx --version
4.3.2

@bdelacretaz
Copy link
Collaborator Author

Still fails for me after deploying with hlx 4.3.2 or 4.4.1.

It looks like the deployed zip for my action contains an older version of htlengine, 2.3.2 according to the node_modules/@adobe/htlengine/CHANGELOG.md file found in that zip:

$ hlx deploy
$ grep package helix-config.yaml
package: bdelacre/48ca0cc0a4b75ee24302b4e56f5c692a2583a736

$ wsk action get /bdelacre/48ca0cc0a4b75ee24302b4e56f5c692a2583a736/html --save
ok: saved action code to html.zip

$ unzip html.zip 
$ head node_modules/@adobe/htlengine/CHANGELOG.md 
## [2.2.2](https://github.com/adobe/htlengine/compare/v2.2.1...v2.2.2) (2019-05-13)

Running similar code than the one which fails, on the node_modules folder found in that html.zip produces the same error:

$ cat > index.js
const {
  Runtime
} = require('@adobe/htlengine');

const notTheRightTypeButWhoCares = "foo";
new Runtime.VDOMFactory(notTheRightTypeButWhoCares);

$ node index.js
TypeError: Runtime.VDOMFactory is not a constructor

And after updating htlengine my test code produces the expected error due to notTheRightTypeButWhoCares:

$  npm uninstall @adobe/htlengine
$  npm install @adobe/htlengine
$ node index.js
TypeError: domImplementation.createHTMLDocument is not a function

IMO this confirms that hlx deploy embeds the wrong version of htlengine for some reason.

If I run head node_modules/@adobe/htlengine/CHANGELOG.md in my helix-example-advanced folder I get the expected 3.2.0 version.

@tripodsan
Copy link
Contributor

you should not have a node_modules folder at all, since you don't need any packages (yet).
anyways, it seems that there might be a stray htlengine module.

I suggest to run:

$ rm -rf node_modules package-lock.json
$ npm install

@tripodsan
Copy link
Contributor

also, it seems you initialized this repo with the helix-service template, which was definitely the wrong choice ;-) it comes with all kinds of scripts and dependencies that we internally need to deploy a new helix service. like:

  "devDependencies": {
    "@adobe/openwhisk-action-builder": "^1.0.2",
    "@semantic-release/changelog": "^3.0.2",
    "@semantic-release/commit-analyzer": "^6.1.0",
    "@semantic-release/exec": "^3.3.2",
    "@semantic-release/git": "^7.0.8",
    "@semantic-release/github": "^5.2.10",
    "@semantic-release/npm": "^5.1.9",
    "@semantic-release/release-notes-generator": "^7.1.4",
    "semantic-release": "^15.13.3",

IMO, a helix-project doesn't need much to start with... probably nothing :-)

@tripodsan
Copy link
Contributor

It looks like the deployed zip for my action contains an older version of htlengine, 2.3.2 according to the node_modules/@adobe/htlengine/CHANGELOG.md file found in that zip:

also, the new helix-cli doesn't embed the modules in the zip anymore, but bundles them inside the big html.js. so the fact that you have individual modules in the .zip shows that something is wrong....

be sure to run:

$ hlx clean && hlx build && hlx package

and then inspect your zip again.

bdelacretaz added a commit that referenced this issue Jun 18, 2019
@bdelacretaz
Copy link
Collaborator Author

Cleaning up everything and streamlining packages.json worked, thank you! Looks like stray dependencies were the cause.

I also hit adobe/helix-cli#241 along the way, forgetting to run hlx build, so my fixed html action was not deployed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants