Skip to content

TypeError: Promise resolver is not a function

Error message

                Promise resolver is not a function
              

Quick summary

You called new Promise() with an argument that is not a function — the Promise constructor expects an executor function (resolve, reject) => {}.

Why this happens

  • Passed a non-function to new Promise() (e.g., a value, object, or undefined)

  • Forgot to pass the executor function to the Promise constructor

  • Passed a function reference incorrectly

Minimal example

✗ Broken code
const p = new Promise(42);
✓ Fixed code
const p = new Promise((resolve) => resolve(42));

new Promise() requires an executor function, not a value. Use Promise.resolve(42) for a simpler approach.

How to diagnose

  • Check what is being passed to new Promise()

  • Ensure it is a function that takes (resolve, reject) parameters

  • Log the type of the argument: console.log(typeof arg)

How to fix

  • Pass a proper executor function: new Promise((resolve, reject) => { ... })

  • If you already have a value, use Promise.resolve(value) instead

How to prevent

  • Always use the arrow function syntax for Promise executors

  • Use Promise.resolve/Promise.reject for known values instead of new Promise

Related Resources

Related Glossary

Related Lessons

← Back to language