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.

OpenAPI: errors under nodejs 10

See original GitHub issue

When executing under Nodejs 10 (the minimum currently supported LTS version), the backend test (cd src ; npm test) cause an error in the server log.

Etherpad version: e6251687bf6f (current develop). Tested under:

  • linux, nodejs 12.13.1 <-- works
  • linux, nodejs 10.14.1 <-- error

This is the relevant snippet:

[2020-04-05 02:50:47.813] [INFO] API - REQUEST, v1.2.14:setHTML, {"apikey":"XXXX","padID":"pWvFw","html":"<div><b>Hello HTML</title></head></div>"}
[2020-04-05 02:50:47.815] [WARN] ImportHtml - HTML was not properly formed TypeError: Cannot read property 'tagName' of undefined
    at Object.nodeTagName (<BASE>/src/static/js/contentcollector.js:50:16)
    at isBlockElement (<BASE>/src/static/js/contentcollector.js:97:31)
    at Object.cc.collectContent (<BASE>/src/static/js/contentcollector.js:395:19)
    at Object.exports.setPadHTML (<BASE>/src/node/utils/ImportHtml.js:41:8)
    at Object.exports.setHTML (<BASE>/src/node/db/API.js:290:16)
    at process._tickCallback (internal/process/next_tick.js:68:7)
TypeError: Cannot read property 'tagName' of undefined
    at Object.nodeTagName (<BASE>/src/static/js/contentcollector.js:50:16)
    at isBlockElement (<BASE>/src/static/js/contentcollector.js:97:31)
    at Object.cc.collectContent (<BASE>/src/static/js/contentcollector.js:395:19)
    at Object.exports.setPadHTML (<BASE>/src/node/utils/ImportHtml.js:41:8)
    at Object.exports.setHTML (<BASE>/src/node/db/API.js:290:16)
    at process._tickCallback (internal/process/next_tick.js:68:7)
[2020-04-05 02:50:47.818] [ERROR] console - (node:52817) [DEP0079] DeprecationWarning: Custom inspection function on Objects via .inspect() is deprecated

I noticed this when trying to run jshint, and it complained that something was only supported on ECMAScript 9 (I had to enable esversion: 9 in .jshintrc).

More details later.

@anttiviljami: can you please investigate? Thanks

Etherpad NodeJS support:

Etherpad 1.8.0 supports node 8 (see the startup logs) and the documentation. Etherpad 1.8.3 will require node 10 (and is required to support it). See #3650. The next version will be called 1.8.3 (bad milestone name)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
muxatorcommented, Apr 6, 2020

See PR #3841 […] This issue doesn’t really seem to have anything to do with introducing openapi-backend. We just notice it now that errors are properly logged from the API.

I see, this is only uncovered by a test.

Thanks for the PR. I will go with that one, for now, because if the log4j configuration format changes in modern versions (and rightly so), we have at least to think about what to do with backward compatibility, and I cannot ask you to do this now.

I agree that the way forward is getting rid of the ancient modules. The migration to OpenAPI was one of the most important moves. 😃

I am going to look at #3841 and incorporate it in 1.8.3.

Thanks

0reactions
JohnMcLearcommented, Apr 7, 2020

Hah whoops 😄 Apols @anttiviljami

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Node.js] server doesn't work · Issue #34 - GitHub
Suggest a fix/enhancement. The error is due to the swagger-tools does not support OAS3. (It is also occurs with OAS2 as api/openapi.
Read more >
open api error: request should have required property '.headers'
I have no property '.headers' mentioned in the open-api.yaml file. I tried removing the validator middleware, and the request went through just ...
Read more >
OpenAPI Specification - Version 2.0 - Swagger
Version 2.0 specification defines a set of files required to describe an API. These files can then be used by the Swagger-UI project...
Read more >
Tutorial - OpenAPI Swagger Extension VS Code - 42Crunch
Our previous tutorial used the build-in Security Editor in 42Crunch Platform to fix audit issues in the OpenAPI (formerly Swagger) definition.
Read more >
Maintaining REST API Documentation with Node.js — Part II
This article details how you can mingle together multiple individual service OpenApi schemas into a global one, remapping their routes, making it easy...
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