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.

Console warning after package upgrade: Invalid arguments supplied to oneOf

See original GitHub issue

[Console warning after package upgrade: Invalid arguments supplied to oneOf]

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Detailed description

I just upgraded the package to it’s latest version. Now I get the following console.log error at half of my tests: Warning: Invalid arguments supplied to oneOf, expected an array, got 4 arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]). I cloned the project to do a global search to find a place using oneOf() without giving an array as argument, but couldn’t find anything. It’s not coming from my own code since I don’t check props validity using propTypes, I use Typescript interfaces

Any idea what could trigger this warning ? It’s kind of spamming my tests and browser console. If you help me locate the issue, I could even make a pull request to fix it myself 😄

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
robherleycommented, Oct 3, 2019

@metonym when is the npm package going to be updated to reflect these changes?

The problem still exists after a clean install of the package:

(fresh directory)
$ npm i carbon-components-react
$ cat node_modules/carbon-components-react/lib/components/InlineLoading/InlineLoading.js | grep oneOf
  status: _propTypes.default.oneOf('inactive', 'active', 'finished', 'error'),
2reactions
robherleycommented, Oct 2, 2019

I’ve noticed this too, and it’s in the InlineLoading component.

The interesting thing is that the proptype in the src of the code is correct (in this repo) but when the package is downloaded from npm, it’s the following:

lib/components/InlineLoading.js

  /**
   * Specify the loading status
   */
  status: _propTypes.default.oneOf('inactive', 'active', 'finished', 'error'),
Read more comments on GitHub >

github_iconTop Results From Across the Web

Warning: Invalid argument supplied to oneOfType, expected ...
error node_modules/prop-types/factoryWithTypeCheckers.js:23 Warning: Invalid argument supplied to oneOfType, expected an instance of array.
Read more >
How to resolve React Warning: Invalid argument supplied to ...
Warning : Invalid argument supplied to oneOfType. Expected an array of check functions, but received undefined at index 2. console.
Read more >
prop-types - NPM Package Compare versions - Socket - Socket.dev
'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;. return emptyFunction.thatReturnsNull;.
Read more >
Changelog - Cypress Documentation
The Cypress App will no longer crash when passed a --spec: {} from the CLI and instead error when passed an invalid object...
Read more >
Error and Warning Dictionary | Twilio
Annotate: Annotate must contain only one of element X ... When updating a contact, invalid JSON syntax or invalid field that cannot be...
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