Skip to content

Update of express from 4 to 5 broke the image #6

Description

@ivy-lgi

This commit from January 2, 2026 (3 days ago) updated the node requirement from >=14 to >=18 and updated express from ^4.17.2 to ^5.2.1 without updating the base image in the Dockerfile and addressing breaking changes of express, consequently breaking the application and image.

The following output is shown when trying to start the image:

> deepl-mock@1.18.0 start /app
> DEEPL_MOCK_SERVER_PORT=${DEEPL_MOCK_SERVER_PORT:-3000} DEEPL_MOCK_PROXY_SERVER_PORT=${DEEPL_MOCK_PROXY_SERVER_PORT:-3001} node index.js

/app/node_modules/merge-descriptors/index.js:13
		if (!overwrite && Object.hasOwn(destination, name)) {
		                         ^

TypeError: Object.hasOwn is not a function
    at mergeDescriptors (/app/node_modules/merge-descriptors/index.js:13:28)
    at createApplication (/app/node_modules/express/lib/express.js:41:3)
    at Object.<anonymous> (/app/index.js:8:13)
    at Module._compile (internal/modules/cjs/loader.js:1114:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
    at Module.load (internal/modules/cjs/loader.js:979:32)
    at Function.Module._load (internal/modules/cjs/loader.js:819:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
    at internal/main/run_main_module.js:17:47
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! deepl-mock@1.18.0 start: `DEEPL_MOCK_SERVER_PORT=${DEEPL_MOCK_SERVER_PORT:-3000} DEEPL_MOCK_PROXY_SERVER_PORT=${DEEPL_MOCK_PROXY_SERVER_PORT:-3001} node index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the deepl-mock@1.18.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/node/.npm/_logs/2026-01-05T11_30_03_509Z-debug.log

Updating the base image in the Dockerfile from node:14-alpine to node:18-alpine and replacing occurrences of app.all('/*', handler) and app.all('*', handler) with app.all('/{*splat}', handler) in the index.js as suggested by the express migration guide resolved this issue in my quick testing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions