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

TypeError: element.includes is not a function #17

Open
ksw25 opened this issue Feb 8, 2022 · 3 comments
Open

TypeError: element.includes is not a function #17

ksw25 opened this issue Feb 8, 2022 · 3 comments

Comments

@ksw25
Copy link

ksw25 commented Feb 8, 2022

No matter what I do, I am facing this issue while using this library.

Example of coding:

 openssl(['x509', '-noout', '-text', '-in', ca.pem, function (err, buffer) {
    console.log(err.toString(), buffer.toString());
  }]);

or

openssl(['x509', '-noout', '-text', '-in', { name:'ca.pem', buffer: BufferVariable }], (output) => console.log(output.toString()));

Error:

{
    "errorType": "Runtime.UnhandledPromiseRejection",
    "errorMessage": "TypeError: element.includes is not a function",
    "reason": {
        "errorType": "TypeError",
        "errorMessage": "element.includes is not a function",
        "stack": [
            "TypeError: element.includes is not a function",
            "    at checkCommandForIO (/var/task/node_modules/@amzn/interceptor-core/node_modules/openssl-nodejs/src/index.js:17:46)",
            "    at openssl (/var/task/node_modules/@amzn/interceptor-core/node_modules/openssl-nodejs/src/index.js:69:13)",
            "    at getKeyFromURL (/var/task/node_modules/@amzn/interceptor-core/src/token-validator.js:53:3)",
            "    at processTicksAndRejections (internal/process/task_queues.js:97:5)"
        ]
    },
    "promise": {},
    "stack": [
        "Runtime.UnhandledPromiseRejection: TypeError: element.includes is not a function",
        "    at process.<anonymous> (/var/runtime/index.js:35:15)",
        "    at process.emit (events.js:314:20)",
        "    at processPromiseRejections (internal/process/promises.js:209:33)",
        "    at processTicksAndRejections (internal/process/task_queues.js:98:32)"
    ]
}

@marianozunino
Copy link

@ksw25 hey man! Here's an alternative for this lib: https://www.npmjs.com/package/openssl-ts

@wanghouqi
Copy link

Change to { name: 'ca.pem', buffer: BufferVariable, includes: function(key){return false} }

@monkeytronics
Copy link

Hey @ksw25,
This error means that the file "ca.pem" is missing from the location expected. I'd double check what's going on with your paths etc, and even do fs.readdir to double check that it's there at run time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants