question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Node SDK: Options variable is not a valid object

See original GitHub issue

throw new Error(‘warning, your options variable is not a valid object.’)

The error points to this:

import nodeMailjet from "node-mailjet"
const mailjet = nodeMailjet.connect(process.env.MAILJET_API_KEY, process.env.MAILJET_API_SECRET)

The env keys are correct and I am not even passing options object. It’s a typescript project. It does run on Ubuntu (Node 12) but this error occurs on Windows (Node 14).

SDK Version: v3.3.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
DharmarajX24commented, May 20, 2021

@flo-sch it’s hard to reproduce the issue. Later I had switched back to Ubuntu. I don’t have the full stack trace but here’s snap. image Then I went through the source code and found that here.

Apparently, clearing cache and a clean install of node modules helped. Though I can confirm the versions were same.

0reactions
scroll17commented, Apr 26, 2022

This issue will be closed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid options object. Dev Server has been initialized using ...
Here is a workaround. Delete "proxy": "http://localhost:6000". Install package http-proxy-middleware with command npm install ...
Read more >
Errors | Node.js v19.3.0 Documentation
Indicates that a program is not valid JavaScript. These errors may only be generated and propagated as a result of code evaluation.
Read more >
Optional chaining (?.) - JavaScript - MDN Web Docs - Mozilla
operator accesses an object's property or calls a function. ... Optional chaining not valid on the left-hand side of an assignment.
Read more >
session - Amazon Web Services - Go SDK
Sessions options from Shared Config. By default NewSession will only load credentials from the shared credentials file (~/.aws/credentials). If the ...
Read more >
Using the Node.js Driver - Snowflake Documentation
If the specified object does not exist, a default is not set during connection. After connecting, all of the optional connection options can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found