Session.run(...).subscribe(...) is undefined

This code seems to work

    session
      //.run('MATCH (n) WITH n MATCH (n)-->(m) WHERE id(m)>0 RETURN id(n) as source, id(m) as target LIMIT $limit', { limit: neo4j.int(100) })
      .run('MATCH (n:Person) RETURN labels(n) as labels,n.name as name,n.born as born,n.died as died ORDER BY n.born,n.died LIMIT $limit', { limit: neo4j.int(100) })
      .subscribe({
        onKeys: keys => {
          console.log('Result columns are:')
          //console.log(keys)
        },
        onNext: record => {
          console.log(`Processing ${record.get('name')}`)
        },
        onCompleted: () => {
          session.close() // returns a Promise
        },
        onError: error => {
          console.log(error)
        }
      })
      .catch(function (error) {
          console.log(error);
      });

However you still get this error

Uncaught TypeError: session.run(...).subscribe(...) is undefined

I got this code from this example. Should I just ignore it, or is there a better example

I'm unable to reproduce this. Here's my code, based on the example in our docs

(async () => {
  var neo4j = require('neo4j-driver')

  // URI examples: 'neo4j://localhost', 'neo4j+s://xxx.databases.neo4j.io'
  const URI = '<YOUR CONNECTION URI'
  const USER = '<YOUR USER>'
  const PASSWORD = '<YOUR PASSWORD>'
  let driver

  try {
    driver = neo4j.driver(URI,  neo4j.auth.basic(USER, PASSWORD))
    const serverInfo = await driver.getServerInfo()
    console.log('Connection established')
    console.log(serverInfo)
  } catch(err) {
    console.log(`Connection error\n${err}\nCause: ${err.cause}`)
    await driver.close()
    return
  }

  // Use the driver to run queries
  const session = driver.session({database: 'neo4j'})
  let peopleNames = []

  session
    .run('MERGE (p:Person {name: $name}) RETURN p.name AS name', {
      name: 'Alice'
    })
    .subscribe({
      onKeys: keys => {
        console.log('Result columns are:')
        console.log(keys)
      },
      onNext: record => {
        console.log(`Processing ${record.get('name')}`)
        peopleNames.push(record.get('name'))
      },
      onCompleted: () => {
        session.close() // returns a Promise
      },
      onError: error => {
        console.log(error)
      }
    })

})();