Skip to content

Fails silently on node 16 #103

@nmpereira

Description

@nmpereira

Description

I was trying out the @axiomhq/js and the @axiomhq/winston packages and both seem to fail on node 16 but give out little to no information/errors.

The documented axiom-winston (https://github.com/axiomhq/axiom-js/tree/main/packages/winston) method were logging the winston logs locally, but not sending it to axiom. There were no errors/messages/indication of why it was failing.

Then I tried the js method (https://github.com/axiomhq/axiom-js/tree/main/packages/js) which failed with ReferenceError: fetch is not defined.

After upgrading to node 20, which does have built-in fetch support, It seemed to work well.

I also did get a Error: Not found that's pretty unhelpful.

[1] Error: Not Found
[1]     at FetchClient.doReq (/Users/.../...node_modules/@axiomhq/src/fetchClient.ts:42:29)
[1]     at processTicksAndRejections (node:internal/process/task_queues:95:5)
[1]     at async Batch.flush (/Users/.../.../node_modules/@axiomhq/src/batch.ts:61:17)

Expected

  1. Documentation about supported node version and/or how to import fetch correctly
  2. fix on axiom-winston to not fail silently
  3. Diagnose Error: Not found error to give more information.
  4. axiom-winston gives no error/information if there are missing/wrong tokens/dataset etc. Need some logs for this.

Info

Failing on node version: v16.20.0
Works fine on node version: v20.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions