{"id":800,"hash":"c22cbdc2bd2fccfa42ebe4eabccf3ebe7fd729e47896f5d763f900a2119b2a7d","pattern":"Invalid option in build() call: &quot;watch&quot;","full_message":"I am following the example as it is described here:\n\nhttps://bilalbudhani.com/chokidar-esbuild/\n\nWhen I do:\n\nnode esbuild.config.js --watch\n\nI get the message:\n\n[ERROR] Invalid option in build() call: \"watch\"\n\nI have no idea why this is happening.\n\nIs \"watch\" not longer a parameter?\n\nI also did this example:\n\nconst path = require('path')\n\nrequire(\"esbuild\").build({\n  entryPoints: [\"application.js\", \"client.js\"],\n  bundle: true,\n  sourcemap: true,\n  outdir: path.join(process.cwd(), \"app/assets/builds\"),\n  absWorkingDir: path.join(process.cwd(), \"app/javascript\"),\n  minify: true,\n  watch: true,\n})\n.then(() => console.log(\"⚡Done\"))\n.catch(() => process.exit(1));\n\nIf i remove the line \"watch:true\", it compiles ok. But if I leave it, I get the same error:\n\nInvalid option in build() call: \"watch\"\n\nwhen I do: node esbuild.config.js","ecosystem":"npm","package_name":"configuration","package_version":null,"solution":"Summing up from the comments:\n\nesbuild <v0.16 has removed the watch option. Most tutorials and HowTos are pointing to that version. Downgrade your esbuild to that if you want to use it like described there.\n\nBetter option is to use esbuild >0.16 which has a built in live reload which combines watch and serve using the newly introduced context","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/75221520/invalid-option-in-build-call-watch","votes":9,"created_at":"2026-04-19T04:51:44.610093+00:00","updated_at":"2026-04-19T04:51:44.610093+00:00"}