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: Cannot read properties of undefined (reading 'replace') #923

Open
alexgleason opened this issue Aug 2, 2024 · 4 comments · May be fixed by #944
Open

TypeError: Cannot read properties of undefined (reading 'replace') #923

alexgleason opened this issue Aug 2, 2024 · 4 comments · May be fixed by #944

Comments

@alexgleason
Copy link

I'm getting some kind of error, but the error handler itself has an error, so I'm not sure what the error is. 😃

error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'replace')
      stack: { value: err.stack + query.origin.replace(/.*\n/, '\n'), enumerable: options.debug },
                                               ^
    at queryError (https://deno.land/x/[email protected]/src/connection.js:392:48)
    at errored (https://deno.land/x/[email protected]/src/connection.js:387:17)
    at error (https://deno.land/x/[email protected]/src/connection.js:379:5)
    at https://deno.land/x/[email protected]/polyfills.js:138:30
    at Array.forEach (<anonymous>)
    at call (https://deno.land/x/[email protected]/polyfills.js:138:16)
    at error (https://deno.land/x/[email protected]/polyfills.js:131:5)
    at eventLoopTick (ext:core/01_core.js:168:7)
@alexgleason
Copy link
Author

alexgleason commented Aug 2, 2024

So I edited the code manually and logged it. err is:

InvalidData: invalid peer certificate: UnknownIssuer
    at async TlsConn.read (ext:deno_net/01_net.js:150:15)
    at async success (https://raw.githubusercontent.com/alexgleason/postgres.js/51ac395234089d5b7806c471830a1a472958fb06/deno/polyfills.js:97:56) {
  name: "InvalidData"
}

And the value of query is... true ??? Bro, this codebase needs TypeScript.

EDIT: It's because query is being set to true here:

initial = query || true

@marbemac
Copy link

Running into this as well

@patrickReiis
Copy link

I'm also having this problem

@tilemanrenovations
Copy link

How long has this been happening?

@alexgleason alexgleason linked a pull request Sep 16, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

4 participants