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.

ChoiceType array crash due to value name

See original GitHub issue

I’ve run into this simultaneously in local and remote running instance of node-hue-api.

Error log is as follows,

Failed to get a remote connection using existing tokens. ApiError: Value ‘allreadytoinstall’ is not one of the allowed values [unknown,noupdates,transferring,anyreadytoinstall,allreadtoinstall,installing]

I’ve temporarily fixed this by adding the following to node_modules/node-hue-api/lib/types/ChoiceType.js


  _convertToType(val) {
    if (this.validValues.indexOf(val) > -1 || val === 'allreadytoinstall') {
      return val;
    } else {
      throw new ApiError(`Value '${val}' is not one of the allowed values [${this.validValues}]`);
    }
  }

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
danWithADcommented, Apr 24, 2020

@peter-murray I can confirm that in both local and prod pulling the latest version from master repo works!

1reaction
peter-murraycommented, Apr 24, 2020

This has been fixed in 5.0.0-alpha.2 which is in the npm registry (or at least it has in my local testing).

Due to this being a fix that will be required in the 4.x releases, I have just released this change in 4.0.6 as well.

@danWithAD please verify when you get a chance

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does anyone know why Symfony ChoiceType choices list ...
Does anyone know why Symfony ChoiceType choices list keep labels as the array keys rather than values? I looked but wasn't able to...
Read more >
[Form] ChoiceType. Wrong render for duplicated choice values
Hello, $builder ->add('choice', ChoiceType::class, array( 'choices' => array( 'No Value' => 'value', 'Default Value' => 'value', ...
Read more >
Symfony 2.3 - Part 7 - Choice and Entity Field Types - YouTube
The first 7 minutes or so is Choice field type using Arrays, then next 7-10 minutes are Choice using Entity field type, then...
Read more >
[Solved]-Symfony Multiple choice on entity field-symfony
The correct usage of ChoiceType is to provide an array of choices, where the array key is the item's label and the array...
Read more >
Debug, view array variable, VS crashes and restarts
Shortly after displaying the fly-out with the first 15 or so values in the array, all of Visual Studio restarts (the application debugging...
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