Giter Site home page Giter Site logo

Comments (4)

ademidun avatar ademidun commented on May 22, 2024

This github issue seems to suggest it's caused by the version of Node I am running. I've upgraded from Node 8 to 10 to 12 and now I am getting:

err: RequestError: connect ECONNREFUSED 127.0.0.1:443
      at ClientRequest.<anonymous> (~/project_root/node_modules/notion-client/node_modules/got/dist/source/core/index.js:956:111)
      at Object.onceWrapper (events.js:421:26)
      at ClientRequest.emit (events.js:326:22)
      at ClientRequest.EventEmitter.emit (domain.js:483:12)
      at ClientRequest.origin.emit (~/project_root/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
      at TLSSocket.socketErrorListener (_http_client.js:427:9)
      at TLSSocket.emit (events.js:314:20)
      at TLSSocket.EventEmitter.emit (domain.js:483:12)
      at emitErrorNT (internal/streams/destroy.js:92:8)
      at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
      at processTicksAndRejections (internal/process/task_queues.js:84:21)
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16)

from react-notion-x.

transitive-bullshit avatar transitive-bullshit commented on May 22, 2024

Hey @ademidun, thanks for reaching out.

What version of Node.js are you running exactly?

from react-notion-x.

ademidun avatar ademidun commented on May 22, 2024
  1. Running node: v10.16.3 (npm v6.9.0) gave me Cannot read property 'startsWith' of undefined.
  2. Running both v12.22.1 and 10.22.0 gave me ECONNREFUSED 127.0.0.1:443.
  3. When I used node v8.10.0 (npm v5.6.0) I got a completely different error (see traceback below):
    1. SyntaxError: Unexpected token *'

Note: I used nvm (Node Version Manager) to switch between different Node versions

'~/project_root/node_modules/notion-client/node_modules/got/dist/source/create.js:157',
  'const paginateEach = (async function* (url, options) {',
  '^',
  '',
'SyntaxError: Unexpected token *',
  'at createScript (vm.js:80:10)',
  'at Object.runInThisContext (vm.js:139:10)',
  'at Module._compile (module.js:616:28)',
  'at Object.Module._extensions..js (module.js:663:10)',
  'at Module.load (module.js:565:32)',
  'at tryModuleLoad (module.js:505:12)',
  'at Function.Module._load (module.js:497:3)',
  'at Module.require (module.js:596:17)',
  'at require (internal/module.js:11:18)',
  'at Object.<anonymous> ~/project_root/node_modules/notion-client/node_modules/got/dist/source/index.js:14:18)',
  'at Module._compile (module.js:652:30)',
  'at Object.Module._extensions..js (module.js:663:10)',
  'at Module.load (module.js:565:32)',
  'at tryModuleLoad (module.js:505:12)',
  'at Function.Module._load (module.js:497:3)',
  'at Module.require (module.js:596:17)',
  'at require (internal/module.js:11:18)',
  'at Object.<anonymous> ~/project_root/node_modules/notion-client/src/notion-api.ts:1:1)',
  'at Module._compile (module.js:652:30)',
  'at Object.Module._extensions..js (module.js:663:10)',
  'at Module.load (module.js:565:32)',
  'at tryModuleLoad (module.js:505:12)',
  'at Function.Module._load (module.js:497:3)',
  'at Module.require (module.js:596:17)',
  'at require (internal/module.js:11:18)',
  'at Object.<anonymous> ~/project_root/node_modules/notion-client/src/index.ts:1:1)',
  'at Module._compile (module.js:652:30)',
  'at Object.Module._extensions..js (module.js:663:10)',
  'at Module.load (module.js:565:32)',
  'at tryModuleLoad (module.js:505:12)',
  'at Function.Module._load (module.js:497:3)',
  'at Module.require (module.js:596:17)',
  'at require (internal/module.js:11:18)',
  'at Object.notion-client ~/project_root/.webpack/service/webpack:/external "notion-client":1:1)',
  'at __webpack_require__ ~/project_root/.webpack/service/webpack:/webpack/bootstrap:19:1)',
  'at Object../notion/notionPages.js ~/project_root/.webpack/service/webpack:/notion/notionPages.js:1:1)',
  'at __webpack_require__ ~/project_root/.webpack/service/webpack:/webpack/bootstrap:19:1)',
  'at Object../server.js ~/project_root/.webpack/service/webpack:/server.js:13:1)',
  'at __webpack_require__ ~/project_root/.webpack/service/webpack:/webpack/bootstrap:19:1)',
  'at ./constants.js.Object.defineProperty.value ~/project_root/.webpack/service/webpack:/webpack/bootstrap:83:1)',
  'at Object.<anonymous> ~/project_root/.webpack/service/server.js:87:10)',
  'at Module._compile (module.js:652:30)',
  'at Object.Module._extensions..js (module.js:663:10)',
  'at Module.load (module.js:565:32)',
  'at tryModuleLoad (module.js:505:12)',
  'at Function.Module._load (module.js:497:3)',
  'at Module.require (module.js:596:17)',
  'at require (internal/module.js:11:18)',
  'at Object.createHandler ~/project_root/node_modules/serverless-offline/src/functionHelper.js:194:17)',
  'at handler ~/project_root/node_modules/serverless-offline/src/index.js:664:44)',
  'at module.exports.internals.Manager.execute ~/project_root/node_modules/@hapi/hapi/lib/toolkit.js:41:33)',
  'at Object.internals.handler ~/project_root/node_modules/@hapi/hapi/lib/handler.js:46:48)',
  'at exports.execute ~/project_root/node_modules/@hapi/hapi/lib/handler.js:31:36)',
  'at Request._lifecycle ~/project_root/node_modules/@hapi/hapi/lib/request.js:312:68)',

from react-notion-x.

transitive-bullshit avatar transitive-bullshit commented on May 22, 2024

We only officially support node >= 12. Note that node v8 is no longer supported by node.js.

The startsWith error with node v10 is expected since we don't support node v10.

The only error here we can really help with is the node v12 one.

ECONNREFUSED 127.0.0.1:443 seems like an issue where your code is trying to access localhost; I would guess this has to do with the serverless-offline.

My advice would be to get your example with node >= 12 working outside of serverless-offline first by running node.js directly. Once that's working, then reintroduce serverless-offline and figure out what's going on there.

Best of luck.

from react-notion-x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.