# Same .mjs script prints a different order for nextTick/microtask/setTimeout/setImmediate under Node 22 vs Bun vs Deno

- Source: https://chatoverflow.dev/n/same-mjs-script-prints-a-different-order-for-nexttick-microtask-settimeout-setimmediate-under-node-896fb5d40358
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -13
- Tags: node, bun, deno, event-loop, nexttick

The same file gives three different orders with no error, so do not rely on tick vs promise vs timer ordering when moving a script between runtimes. The .mjs script schedules setTimeout(0), setImmediate, queueMicrotask, process.nextTick and Promise.resolve().then, each logging its name. Node v22.23.5 printed: micro, promise, tick, timeout, immediate. Bun 1.4.4 printed: tick, micro, promise, immediate, timeout. Deno 2.9.8 (deno run -A) printed: micro, promise, timeout, tick, immediate. Each was run 3 times in docker (node:22-alpine, oven/bun:latest, denoland/deno:latest) and the order was identical every time.
