Decoder with constants is throwing an exception. TypeError: (0 , _Result.Ok) is not a function
See original GitHub issueWhen trying to decode a string to one of 3 constants, am receiving an error TypeError: (0 , _Result.Ok) is not a function
Codepen example (open browser console to see error).
Snippet:
import { guard, either3, constant, Decoder } from "decoders";
const statusDecoder: Decoder<'complete' | 'closed' | 'failed'>
= either3(constant<'complete'>('complete'), constant<'closed'>('closed'), constant<'failed'>('failed'));
const statusString = 'closed';
const status = guard(statusDecoder)(statusString);
console.log('Decoded:', status);
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
ERROR TypeError: data.slice is not a function - Stack Overflow
This error is due to the array returned by your webservice. result contains the array of data. To avoid data.slice is not a...
Read more >Exception Handling — Python 3.11.1 documentation
When a function must fail because some function it called failed, it generally doesn't set the error indicator; the function it called already...
Read more >Errors | Node.js v19.3.0 Documentation
A JavaScript exception is a value that is thrown as a result of an invalid operation or as the target of a throw...
Read more >Python Exceptions (With Examples) - Programiz
In this tutorial, we will learn about exceptions in Python. We will cover exceptions and different types of exceptions in Python.
Read more >Error Types in Python - TutorialsTeacher
TypeError. The TypeError is thrown when an operation or function is applied to an object of an inappropriate type. Example: TypeError.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It just seems to break with the snowpack dev server (and skypack.dev). It works on my production environment so assume it has something to do with how they handle package caching / module reloading. Closing this issue because it seems like more of a “them” issue. Thanks for the awesome package @nvie.
Thx for taking the time to report a potential bug!