CSS UI Error on code node

Describe the problem/error/question

Hello community, for an unknow reason the css on my code node seem off, i don’t know how to fix it, i had updated from 2.18.3 to 2.21.1, the css problem is still there, i don’t know how to fix it. that error is only on the code node, other node are fine.

What is the error message (if any)?

Here are the error that i found:
Incorrect use of

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Here is the node that caused the problem:
{
  "nodes": [
    {
      "parameters": {
        "jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n  item.json.myNewField = 1;\n}\n\nreturn $input.all();"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        416,
        96
      ],
      "id": "0a1a29bd-13ec-4717-b622-ad2587041116",
      "name": "Code in JavaScript"
    }
  ],
  "connections": {},
  "pinData": {},
  "meta": {
    "instanceId": "b0fc05f5831e0906bc328dbb91212206b4dba262a6284043095cd6d17747527a"
  }
}

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 2.21.1
  • Database (default: SQLite): postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app):docker version 29.5.2
  • Operating system: ubuntu

@mahay that broken layout looks like stale CSS from ur 2.18.3 install — n8n’s frontend ships versioned chunks and a service worker / browser cache can pin to the old ones across upgrades. quick check before digging deeper: open n8n in an incognito window or hard-refresh (ctrl+shift+r). does the Code node still look broken there?

if incognito is clean → browser-side, just clear site data for the n8n domain. if incognito is still broken → server-side, usually a reverse proxy serving stale /assets/*.css or the old static files still in a mounted volume.

Hi @mahay

It looks like the visual glitch you’re seeing in the Code node is a rendering problem. This usually happens when your browser or your Docker container is holding onto old styling files from a previous version, which conflicts with the new update and makes the layout look “off.”

The quickest way to fix this is to clear your browser’s memory. Try doing a “hard refresh” (Ctrl + F5) or open n8n in an incognito window. If the layout looks normal in incognito mode, it means your browser just needs its cache cleared to remove the old CSS.

If the browser fix doesn’t work, the problem might be inside your Docker setup. Sometimes updating the version isn’t enough; you may need to stop the container, pull a fresh copy of the n8n image from the web, and restart it. This ensures that all the latest visual components are properly installed and active.

# Stop and remove the current container
docker stop <your-container-id>
docker rm <your-container-id>

# Pull the latest image explicitly to ensure you have the freshest build
docker pull n8nio/n8n:2.22.5

# Restart your container using your usual docker run or docker-compose up -d command

Lastly, try a few simple layout tricks. Make sure your browser zoom is set exactly to 100%, as zooming in or out can break n8n’s design. You can also try manually dragging the edges of the Code node panel to resize it, which often forces the software to recalculate the layout and snap everything back into place.

Thanks effectively affect, that was the solution, i didn’t thinked of removing the cache, thanks to the community.