Custom Image build compilation failed

Describe the issue/error/question

We didn’t update the code, but he still failed,
I used the code without any changes to build the image, which is still the same mistake

What is the error message (if any)?

[hk-tech-node-01 n8n-n8n-0.168.2]# docker build -t n8n-custom:0.168 -f docker/images/n8n-custom/Dockerfile .
Sending build context to Docker daemon 21.63MB
Step 1/29 : FROM node:16-alpine as builder
—> 5dcd1f6157bd
Step 2/29 : USER root
—> Running in c39592c72b61
Removing intermediate container c39592c72b61
—> 3aae27721986
Step 3/29 : RUN npm install -g [email protected]
—> Running in b924cc7baa7d

changed 54 packages, and audited 212 packages in 1s

11 packages are looking for funding
run npm fund for details

found 0 vulnerabilities
Removing intermediate container b924cc7baa7d
—> b4c8d3124fb7
Step 4/29 : RUN apk --update add --virtual build-dependencies python3 build-base ca-certificates && npm_config_user=root npm install -g lerna
—> Running in 616609bfab5a
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
(1/30) Installing libbz2 (1.0.8-r1)
(2/30) Installing expat (2.4.8-r0)
(3/30) Installing libffi (3.4.2-r1)
(4/30) Installing gdbm (1.23-r0)
(5/30) Installing xz-libs (5.2.5-r1)
(6/30) Installing mpdecimal (2.5.1-r1)
(7/30) Installing ncurses-terminfo-base (6.3_p20220521-r0)
(8/30) Installing ncurses-libs (6.3_p20220521-r0)
(9/30) Installing readline (8.1.2-r0)
(10/30) Installing sqlite-libs (3.38.5-r0)
(11/30) Installing python3 (3.10.5-r0)
(12/30) Installing binutils (2.38-r3)
(13/30) Installing libmagic (5.41-r0)
(14/30) Installing file (5.41-r0)
(15/30) Installing libgomp (11.2.1_git20220219-r2)
(16/30) Installing libatomic (11.2.1_git20220219-r2)
(17/30) Installing gmp (6.2.1-r2)
(18/30) Installing isl22 (0.22-r0)
(19/30) Installing mpfr4 (4.1.0-r0)
(20/30) Installing mpc1 (1.2.1-r0)
(21/30) Installing gcc (11.2.1_git20220219-r2)
(22/30) Installing musl-dev (1.2.3-r0)
(23/30) Installing libc-dev (0.7.2-r3)
(24/30) Installing g++ (11.2.1_git20220219-r2)
(25/30) Installing make (4.3-r0)
(26/30) Installing fortify-headers (1.1-r1)
(27/30) Installing patch (2.7.6-r7)
(28/30) Installing build-base (0.5-r3)
(29/30) Installing ca-certificates (20220614-r0)
(30/30) Installing build-dependencies (20220909.023237)
Executing busybox-1.35.0-r17.trigger
Executing ca-certificates-20220614-r0.trigger
OK: 237 MiB in 46 packages

added 587 packages, and audited 588 packages in 16s

57 packages are looking for funding
run npm fund for details

found 0 vulnerabilities
Removing intermediate container 616609bfab5a
—> 5c1b5a657fe8
Step 5/29 : WORKDIR /data
—> Running in 16bc08bfb936
Removing intermediate container 16bc08bfb936
—> a1192bf82830
Step 6/29 : COPY lerna.json .
—> 518739f0605f
Step 7/29 : COPY package.json .
—> 069d5972989b
Step 8/29 : COPY packages/cli/ ./packages/cli/
—> 3f012b831cf3
Step 9/29 : COPY packages/core/ ./packages/core/
—> 1cde5ad27998
Step 10/29 : COPY packages/design-system/ ./packages/design-system/
—> 93f3fa5decd1
Step 11/29 : COPY packages/editor-ui/ ./packages/editor-ui/
—> 16659b8a3eba
Step 12/29 : COPY packages/nodes-base/ ./packages/nodes-base/
—> 757635ae83c4
Step 13/29 : COPY packages/workflow/ ./packages/workflow/
—> 5d83bfd3ade1
Step 14/29 : RUN rm -rf node_modules packages//node_modules packages//dist
—> Running in e837a8f8d1f4
Removing intermediate container e837a8f8d1f4
—> 021ede9c68bd
Step 15/29 : RUN npm config set legacy-peer-deps true
—> Running in 94c5025f4807
Removing intermediate container 94c5025f4807
—> 0a5f633f75a6
Step 16/29 : RUN npm install --production --loglevel notice
—> Running in d3e5fce9f1a8
npm WARN config production Use --omit=dev instead.

up to date, audited 1 package in 7s

found 0 vulnerabilities
Removing intermediate container d3e5fce9f1a8
—> 07c9452c726c
Step 17/29 : RUN lerna bootstrap --hoist – --production
—> Running in 7d093ccfae58
lerna notice cli v5.5.0
lerna info versioning independent
lerna info Bootstrapping 6 packages
lerna WARN EHOIST_PKG_VERSION “n8n” package depends on @types/[email protected]^8.3.0, which differs from the hoisted @types/[email protected]^8.3.2.
lerna WARN EHOIST_PKG_VERSION “n8n-core” package depends on @types/[email protected]^8.3.4, which differs from the hoisted @types/[email protected]^8.3.2.
lerna WARN EHOIST_PKG_VERSION “n8n” package depends on [email protected]^4.1.1, which differs from the hoisted [email protected]~4.1.1.
lerna WARN EHOIST_PKG_VERSION “n8n” package depends on [email protected]^6.7.1, which differs from the hoisted [email protected]^6.5.0.
lerna WARN EHOIST_PKG_VERSION “n8n” package depends on [email protected]^8.3.0, which differs from the hoisted [email protected]^8.3.2.
lerna info Installing external dependencies
lerna info hoist Installing hoisted dependencies into root
lerna info hoist Pruning hoisted dependencies
lerna info hoist Finished pruning hoisted dependencies
lerna info hoist Finished bootstrapping root
lerna info Symlinking packages and binaries
lerna success Bootstrapped 6 packages
Removing intermediate container 7d093ccfae58
—> da50028b96d9
Step 18/29 : RUN npm run build
—> Running in c8b82aa17586

[email protected] build
lerna exec npm run build

lerna notice cli v5.5.0
lerna info versioning independent
lerna info Executing command in 6 packages: “npm run build”

[email protected] build
npm run build:theme

[email protected] build
tsc

[email protected] build:theme
gulp build:theme

[02:36:35] Using gulpfile /data/packages/design-system/gulpfile.js
[02:36:35] Starting ‘build:theme’…
[02:36:35] Starting ‘compileTheme’…
[02:36:38] Finished ‘compileTheme’ after 2.31 s
[02:36:38] Starting ‘copyThemeFonts’…
[02:36:38] Finished ‘copyThemeFonts’ after 30 ms
[02:36:38] Finished ‘build:theme’ after 2.35 s

[email protected] build
tsc

[email protected] build
cross-env VUE_APP_PUBLIC_PATH=“/%BASE_PATH%/” vue-cli-service build

  • Building for production…

[email protected] build
tsc && gulp build:icons && gulp build:translations

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

[02:37:22] Using gulpfile /data/packages/nodes-base/gulpfile.js
[02:37:22] Starting ‘build:icons’…
[02:37:22] Finished ‘build:icons’ after 255 ms
[02:37:22] Using gulpfile /data/packages/nodes-base/gulpfile.js
[02:37:22] Starting ‘build:translations’…
Default locale set to: en
No translation required - Skipping translations build…
[02:37:22] Finished ‘build:translations’ after 1.76 ms
ERROR Failed to compile with 1 error2:38:00 AM

error in src/components/mixins/emitter.ts:26:5

TS2322: Type ‘Vue<Record<string, any>, Record<string, any>, never, never, (event: string, …args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, …>> | null’ is not assignable to type ‘Vue<Record<string, any>, Record<string, any>, never, never, (event: string, …args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, …>>’.
Type ‘null’ is not assignable to type ‘Vue<Record<string, any>, Record<string, any>, never, never, (event: string, …args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, …>>’.
24 |
25 | while (parent && (!name || name !== componentName)) {

26 | parent = parent.$parent;
| ^^^^^^
27 |
28 | if (parent) {
29 | name = parent.$options.name;

Error parsing bundle asset “/data/packages/editor-ui/dist/js/app.46f40fd9.js”: no such file
Error parsing bundle asset “/data/packages/editor-ui/dist/js/chunk-2d2073c1.0092aa08.js”: no such file
Error parsing bundle asset “/data/packages/editor-ui/dist/js/chunk-2d22d3e6.63d9eef8.js”: no such file
Error parsing bundle asset “/data/packages/editor-ui/dist/js/chunk-4301fce8.9b17b8ed.js”: no such file
Error parsing bundle asset “/data/packages/editor-ui/dist/js/chunk-b1e1f7c0.ec07c689.js”: no such file
Error parsing bundle asset “/data/packages/editor-ui/dist/js/chunk-vendors.ce09eb9b.js”: no such file
Error parsing bundle asset “/data/packages/editor-ui/dist/editor.worker.js”: no such file
Error parsing bundle asset “/data/packages/editor-ui/dist/json.worker.js”: no such file
Error parsing bundle asset “/data/packages/editor-ui/dist/ts.worker.js”: no such file

No bundles were parsed. Analyzer will show only original module sizes from stats file.

Webpack Bundle Analyzer saved report to /data/packages/editor-ui/dist/report.html
ERROR Build failed with errors.
lerna ERR! npm run build exited 1 in ‘n8n-editor-ui’
lerna ERR! npm run build exited 1 in ‘n8n-editor-ui’
The command ‘/bin/sh -c npm run build’ returned a non-zero code: 1

Information on your n8n setup

  • **n8n version:0.168.2
  • Database you’re using (default: SQLite):
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]:

Hey @ChaseYu,

Welcome to the community :tada:

Does it fail if you use the latest release as well?

I tried the versions of 0.188.0 and 0.193.5, and they run normally. I also tested 0.178.2, and he will also report an error

However, the version we are currently producing and using is 0.168.2

Hey @ChaseYu,

It sounds like it could be an issue we were aware of and resolved. Have you tried comparing the docker files to see if there is anything different?

We have not updated the dockerfile, so it is the same as the original one

‘’’
[[email protected] n8n-n8n-0.168.2]# cat docker/images/n8n-custom/Dockerfile
# 1. Create an image to build n8n
FROM node:16-alpine as builder

# Update everything and install needed dependencies
USER root

RUN npm install -g [email protected]
# Install all needed dependencies
RUN apk --update add --virtual build-dependencies python3 build-base ca-certificates &&
npm_config_user=root npm install -g lerna

WORKDIR /data

COPY lerna.json .
COPY package.json .
COPY packages/cli/ ./packages/cli/
COPY packages/core/ ./packages/core/
COPY packages/design-system/ ./packages/design-system/
COPY packages/editor-ui/ ./packages/editor-ui/
COPY packages/nodes-base/ ./packages/nodes-base/
COPY packages/workflow/ ./packages/workflow/
RUN rm -rf node_modules packages//node_modules packages//dist

RUN npm config set legacy-peer-deps true
RUN npm install --production --loglevel notice
RUN lerna bootstrap --hoist – --production
RUN npm run build

# 2. Start with a new clean image with just the code that is needed to run n8n
FROM node:16-alpine

USER root

RUN apk add --update graphicsmagick tzdata tini su-exec git

WORKDIR /data

# Install all needed dependencies
RUN npm_config_user=root npm install -g full-icu

# Install fonts
RUN apk --no-cache add --virtual fonts msttcorefonts-installer fontconfig &&
update-ms-fonts &&
fc-cache -f &&
apk del fonts &&
find /usr/share/fonts/truetype/msttcorefonts/ -type l -exec unlink {} ;

ENV NODE_ICU_DATA /usr/local/lib/node_modules/full-icu

COPY --from=builder /data ./

COPY docker/images/n8n-custom/docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT [“tini”, “–”, “/docker-entrypoint.sh”]

EXPOSE 5678/tcp
‘’’

And is this running against the complete codebase for 168 or a modified version?

I assume as you are using a custom image and not the supplied 168 version there are some changes being made?

This is the full version without modification

If this part of the code is not modified, compilation errors will also occur

It should be the same problem as this, but I can’t find a solution

Hey @ChaseYu,

Looking at that one they updated to the latest version which got around the issue, I will take a look later today at this one to see if I can work out what is going on. Out of interest is there a reason why you can’t use the image we provide or use the later release as we know it works?

We are happy to try to use the new version, which will take some time, but our production environment is currently using version 0.168.2