TypeError: NetworkError when fetching to Localhost n8n from Browser Bookmarklet

Describe the problem/error/question

I am using a Javascript bookmarklet to send page data to a local n8n instance running on Docker Desktop.
Despite having the workflow Active and using the Production URL, every attempt to trigger the webhook results in: Network error: TypeError: NetworkError when attempting to fetch resource.

What I have confirmed:

  1. Port Mapping: My Docker container is mapped to a custom port (e.g., 8000:5678) because of a previous port conflict. I can access the n8n UI perfectly at http://localhost:8000.
  2. Workflow Status: The workflow is Active (and I have also tried the Test URL while “Listening”).
  3. The Script: The JS fetch points to http://localhost:8000/webhook/``....

What is the error message (if any)?

Network error: TypeError: NetworkError when attempting to fetch resource.

hey zeta, it’s not an n8n problem.
It is a browser security (CORS) issue.
can ask you is have you update your docker variable yaml match exactly with your port?
if you haven’t updated u must restart the container in your terminal local host for more easy

hey anastasyah,

thank you so much that you reach out to help me out.

I haven’t created yaml file, but if you are referring to environment variable, yes i have match the port. Also, if this is browser security issue, is there any way to bypass it? I am stuck with just one node.

sure zeta

here’s you should do,
since you said your running n8n instance on docker dekstop you should be in terminal based on what dekstop u were using such as mac,or windows . before you paste make sure you know your container name excatly (if you wanna check you container name) type this

docker ps

after you know ur container name such as n8n, tthe paste it below. one by one,

  1. docker stop n8n
  2. docker rm n8n

after you in second step paste this variable

docker run -it --name n8n
-p 8000:5678
-e N8N_CORS_ALLOW_ORIGIN=*
-e WEBHOOK_URL=http://localhost:8000/
n8nio/n8n

btw, when you first running your docker what u using, is it
docker run or docker compose, or maybe also Run from Docker desktop UI?