Giter Club home page Giter Club logo

Comments (15)

haoliu-amp avatar haoliu-amp commented on August 20, 2024 2

@mc-lovin @MrAlekhin @nihiser Hey all, I published a new version v0.3.2. Mind try it out? Thanks!
https://www.npmjs.com/package/@amplitude/node

from amplitude-node.

nihiser avatar nihiser commented on August 20, 2024 2

@haoliu-amp I am on node 13.5.0. Just updated and working fine! Thanks!

from amplitude-node.

haoliu-amp avatar haoliu-amp commented on August 20, 2024

It looks correct to me. Did you add @amplitude/node package as well?

from amplitude-node.

MrAlekhin avatar MrAlekhin commented on August 20, 2024

Hello! having the same issue with AMP. added only @amplitude/node

from amplitude-node.

haoliu-amp avatar haoliu-amp commented on August 20, 2024

Could you provide more details about this error? Like which line triggered this?

from amplitude-node.

MrAlekhin avatar MrAlekhin commented on August 20, 2024

@haoliu-amp the same as here.

    const client = Amplitude.init(config.amplitude.key);
    client.logEvent({
      event_type: "Node Event",
      user_id: "Test",
    });

from amplitude-node.

MrAlekhin avatar MrAlekhin commented on August 20, 2024

@haoliu-amp did you do any changes to the logEvent method recently?

maybe there has to be || instead of ??. because as I understand you want to provide a default value.

const req = https.request(this._options.serverUrl ?? AMPLITUDE_SERVER_URL, requestOptions);

from amplitude-node.

haoliu-amp avatar haoliu-amp commented on August 20, 2024

@MrAlekhin Which version are you using btw? Also would you mind share the stacktrace too?

from amplitude-node.

MrAlekhin avatar MrAlekhin commented on August 20, 2024

@haoliu-amp
version 0.3.1

TypeError: "listener" argument must be a function
    at ClientRequest.once (events.js:340:11)
    at new ClientRequest (_http_client.js:174:10)
    at Object.request (http.js:39:10)
    at Object.request (https.js:245:15)
    at NodeClient.logEvent (/Users/artem/FitCompete/fitcompete_api_v2/node_modules/@amplitude/node/dist/nodeClient.js:47:25)
    at Post.findById.then (/Users/artem/FitCompete/fitcompete_api_v2/server/routes/post_routes.js:84:19)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:229:7)

from amplitude-node.

haoliu-amp avatar haoliu-amp commented on August 20, 2024

@MrAlekhin Thank you! Would you like to try 0.2.0 real quick to see if that version works for you?

from amplitude-node.

MrAlekhin avatar MrAlekhin commented on August 20, 2024

@haoliu-amp looks like the same error 🤷‍♂️

TypeError: "listener" argument must be a function
    at ClientRequest.once (events.js:340:11)
    at new ClientRequest (_http_client.js:174:10)
    at Object.request (http.js:39:10)
    at Object.request (https.js:245:15)
    at NodeClient.logEvent (/Users/artem/FitCompete/fitcompete_api_v2/node_modules/@amplitude/node/dist/nodeClient.js:31:25)
    at Post.findById.then (/Users/artem/FitCompete/fitcompete_api_v2/server/routes/post_routes.js:84:19)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:229:7)

package.lock

 "@amplitude/node": {
      "version": "0.2.0",
      "resolved": "https://registry.npmjs.org/@amplitude/node/-/node-0.2.0.tgz",
      "integrity": "sha512-zod9xiz7So14KyFMYu6/saSLn2iYGpkKxGvdEHOZCXau1yNb/zBcMFSb6FaxkN4sj7ZEaQMI7ATD18Z5Vuk/Mg==",
      "requires": {
        "tslib": "^1.9.3"
      }
    },

from amplitude-node.

haoliu-amp avatar haoliu-amp commented on August 20, 2024

Wonder what version of node are you using? Mine is v12.16.1.
It looks very similar to https://www.reddit.com/r/learnjavascript/comments/fshsy5/how_do_i_fix_typeerror_listener_argument_must_be/

from amplitude-node.

mc-lovin avatar mc-lovin commented on August 20, 2024

+1 Having the same issue.

from amplitude-node.

haoliu-amp avatar haoliu-amp commented on August 20, 2024

@MrAlekhin @nihiser @nihiser What version of node are you guys using? Look like it might be because of the node version compatibility issue.

from amplitude-node.

mc-lovin avatar mc-lovin commented on August 20, 2024

@haoliu-amp node version 13.9 here

from amplitude-node.

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.