Issue on compiling in a dockercontainer

Hello,

I am running into a build error on n8n inside of a docker container.
When I build it locally on my machine it works without any issues so I am quite confused on why it’s failing.
Never made any changes to the file where it errors.

command:
lerna exec npm run build

Errormessage:
#24 300.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, …>>’.
#24 300.5 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, …>>’.

Hi @Bennse,
can you post your actual docker file? Are you using our n8n-custom docker image to build your custom docker image?

1 Like

Hi Marcus,
if I had any information on which dockerfile is being used, I would tell you.
I am only adding new nodes when needed.
It always worked before even after adding a new node.
Now I added another one and it started failing.

edit: Noone else made any changes since the last working change

What n8n version are you using? Did you update your n8n version recently?

Can you try reinstalling npm dependencies?

lerna clean
lerna bootstrap --hoist
npm run build

Version should be this: 0.172.0 ?
At least that’s what the n8n process says about version.
We did not do any recent updates (mostly because it usually broke something)

The docker is being built from scratch on every change to prevent issues so I doubt that, but I will try something.
And as I mentioned above, locally it works without any issue.

Okay so apparently it only fails inside of dockers.
Locally outside of a docker it does not get any error (I usually don’t use a docker when testing locally due to obvious reasons).

I tried with both the normal n8n dockerfile and the n8n custom one
Not really sure what else I could check…
especially since the Error doesn’t really tell me much

Hey @Bennse,

Could you run us through the exact process you are taking including how you are making your build docker container? It feels like we are missing a massive chunk of information and the more detail we have the better.

Hi @Jon

For testing the dockerbuild locally I used the n8n custom dockerfile provided by you with the given commandline input: docker build -t n8n-custom -f docker/images/n8n-custom/Dockerfile .

I am not really sure what information you need tbh as I am not taking any weird steps or such.
All I did was adding a new node the same way I did before which never caused any issue (and since running n8n locally outside of a docker works… I am really not sure what is wrong or where I could have failed)
To run it locally I use: npm run build && ./packages/cli/bin/n8n start

Hey @Bennse,

Perfect, So how are you adding your node to the docker image or is it just part of the n8n node folder directly rather than an npm package?

Have you tried cloning the main repo and just running the build command to see if that works?

Hi @Jon ,
I added the node directly to the n8n node folder(s), not as npm package.
The branch that does not have the new node does work.

Hey @Bennse,

That is interesting it almost sounds like it is something with the changes in your node but it works locally :thinking:

What else is in the error? There could be something else earlier that point towards the issue.

Hey @Jon

exactly, that’s why I am really confused tbh.
Haven’t found anything else that looks like an error earlier in the console, checked multiple times.
Just the usual docker building-log where it goes through every step.

So the screenshot I posted is everything

Hey @Bennse,

The bit with an issue may not say error, What is the node you are adding doing?

Hey @Jon ,

the node is for Jira Tempo API mainly to request the worklogs for specific tickets/projects (REST API documentation) (also fully works locally besides the issues that are on the side of the Tempo API)

Hey @Bennse,

The only thing I can think of is there is something local on your machine that is needed which isn’t being added to the container or installed. Are you using any extra packages?

Although it looks like the failure is probably earlier on, Can we get the full output?

Hey @Jon,

I haven’t added any new package, no.
Due to some secrets I will have to check again which area I can send. Will be tomorrow though due to my workday being over for now.

Hey @Bennse,

No problem, Ideally we would need all of the file but anything sensitive in the log file you can just replace with or similar.

Hello,

I am back with the adjusted dockerlog.
Replaced all the sensitive data.

Pulling secret + docker build --file=./docker/images/n8n-custom/Dockerfile --tag=secret --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from=secret --progress=plain .

#1 [internal] load build definition from Dockerfile
#1 docker sha
#1 transferring dockerfile: 1.61kB 0.1s done
#1 DONE 0.1s

#2 [internal] load .dockerignore
#2 docker sha
#2 transferring context: 32B 0.0s
#2 transferring context: 93B 0.1s done
#2 DONE 0.1s

#3 [internal] load metadata for Docker
#3 docker sha
#3 DONE 0.3s

#11 [internal] load build context
#11 docker sha
#11 DONE 0.0s

#4 [stage-1 1/7] FROM Docker sha
#4 docker sha
#4 DONE 0.0s

#28 [auth] secret
#28 docker sha
#28 DONE 0.0s

#27 importing cache manifest from secret
#27 docker sha
#27 No Cache found

#5 [stage-1 2/7] RUN apk add --update graphicsmagick tzdata tini su-exec git
#5 docker sha
#5 CACHED

#6 [stage-1 3/7] WORKDIR /data
#6 docker sha
#6 CACHED

#7 [stage-1 4/7] RUN npm_config_user=root npm install -g full-icu
#7 docker sha
#7 CACHED

#8 [stage-1 5/7] 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 {} ;
#8 docker sha
#8 CACHED

#11 [internal] load build context
#11 docker sha
#11 transferring context: 17.87MB 1.0s done
#11 DONE 1.0s

#15 [builder 7/16] COPY packages/core/ ./packages/core/
#15 docker sha
#15 CACHED

#10 [builder 3/16] WORKDIR /data
#10 docker sha
#10 CACHED

#17 [builder 9/16] COPY packages/editor-ui/ ./packages/editor-ui/
#17 docker sha
#17 CACHED

#9 [builder 2/16] RUN apk --update add --virtual build-dependencies python3 build-base ca-certificates && npm_config_user=root npm install -g lerna
#9 docker sha
#9 CACHED

#16 [builder 8/16] COPY packages/design-system/ ./packages/design-system/
#16 docker sha
#16 CACHED

#18 [builder 10/16] COPY packages/nodes-base/ ./packages/nodes-base/
#18 docker sha
#18 CACHED

#20 [builder 12/16] RUN rm -rf node_modules packages//node_modules packages//dist
#20 docker sha
#20 CACHED

#21 [builder 13/16] RUN npm config set legacy-peer-deps true
#21 docker sha
#21 CACHED

#13 [builder 5/16] COPY package.json .
#13 docker sha
#13 CACHED

#14 [builder 6/16] COPY packages/cli/ ./packages/cli/
#14 docker sha
#14 CACHED

#12 [builder 4/16] COPY lerna.json .
#12 docker sha
#12 CACHED

#22 [builder 14/16] RUN npm install --production --loglevel notice
#22 docker sha
#22 CACHED

#19 [builder 11/16] COPY packages/workflow/ ./packages/workflow/
#19 docker sha
#19 CACHED

#23 [builder 15/16] RUN lerna bootstrap --hoist – --production
#23 docker sha
#23 CACHED

#24 [builder 16/16] RUN npm run build
#24 docker sha
#24 1.620
#24 1.620 > [email protected] build
#24 1.620 > lerna exec npm run build
#24 1.620
#24 2.478 lerna notice cli v5.2.0
#24 2.482 lerna info versioning independent
#24 2.577 lerna info Executing command in 6 packages: “npm run build”
#24 3.346
#24 3.346 > [email protected] build
#24 3.346 > npm run build:theme
#24 3.346
#24 3.349
#24 3.349 > [email protected] build
#24 3.349 > tsc
#24 3.349
#24 4.090
#24 4.090 > [email protected] build:theme
#24 4.090 > gulp build:theme
#24 4.090
#24 9.424 [07:52:40] Using gulpfile /data/packages/design-system/gulpfile.js
#24 9.426 [07:52:40] Starting ‘build:theme’…
#24 9.429 [07:52:40] Starting ‘compileTheme’…
#24 19.55 [07:52:51] Finished ‘compileTheme’ after 10 s
#24 19.55 [07:52:51] Starting ‘copyThemeFonts’…
#24 19.62 [07:52:51] Finished ‘copyThemeFonts’ after 77 ms
#24 19.63 [07:52:51] Finished ‘build:theme’ after 10 s
#24 24.70
#24 24.70 > [email protected] build
#24 24.70 > tsc
#24 24.70
#24 24.71
#24 24.71 > [email protected] build
#24 24.71 > cross-env secret vue-cli-service build
#24 24.71
#24 29.41
#24 29.41 - Building for production…
#24 49.52
#24 49.52 > [email protected] build
#24 49.52 > tsc && gulp build:icons && gulp build:translations
#24 49.52
#24 195.4 [07:55:46] Using gulpfile /data/packages/nodes-base/gulpfile.js
#24 195.4 [07:55:46] Starting ‘build:icons’…
#24 196.5 [07:55:47] Finished ‘build:icons’ after 1.13 s
#24 198.3 [07:55:49] Using gulpfile /data/packages/nodes-base/gulpfile.js
#24 198.3 [07:55:49] Starting ‘build:translations’…
#24 198.3 Default locale set to: en
#24 198.3 No translation required - Skipping translations build…
#24 198.3 [07:55:49] Finished ‘build:translations’ after 3.98 ms
#24 218.5
#24 300.5 ERROR Failed to compile with 1 error7:57:31 AM
#24 300.5
#24 300.5 error in src/components/mixins/emitter.ts:26:5
#24 300.5
#24 300.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, …>>’.

#24 300.5 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 300.5 24
#24 300.5 25 while (parent && (!name || name !== componentName)) {
#24 300.5 > 26 parent = parent.$parent;
#24 300.5 | ^^^^^^
#24 300.5 27
#24 300.5 28 if (parent) {
#24 300.5 29 name = parent.$options.name;
#24 300.5
#24 301.9 Error parsing bundle asset “/data/packages/editor-ui/dist/js/app.227030c2.js”: no such file
#24 301.9 Error parsing bundle asset “/data/packages/editor-ui/dist/js/chunk-2d2073c1.0092aa08.js”: no such file
#24 301.9 Error parsing bundle asset “/data/packages/editor-ui/dist/js/chunk-2d22d3e6.63d9eef8.js”: no such file
#24 301.9 Error parsing bundle asset “/data/packages/editor-ui/dist/js/chunk-4301fce8.9b17b8ed.js”: no such file
#24 301.9 Error parsing bundle asset “/data/packages/editor-ui/dist/js/chunk-b1e1f7c0.ec07c689.js”: no such file
#24 301.9 Error parsing bundle asset “/data/packages/editor-ui/dist/js/chunk-vendors.d75cd94f.js”: no such file
#24 301.9 Error parsing bundle asset “/data/packages/editor-ui/dist/editor.worker.js”: no such file
#24 301.9 Error parsing bundle asset “/data/packages/editor-ui/dist/json.worker.js”: no such file
#24 301.9 Error parsing bundle asset “/data/packages/editor-ui/dist/ts.worker.js”: no such file
#24 301.9
#24 301.9 No bundles were parsed. Analyzer will show only original module sizes from stats file.
#24 301.9
#24 302.1 Webpack Bundle Analyzer saved report to /data/packages/editor-ui/dist/report.html
#24 302.1 ERROR Build failed with errors.
#24 302.2 lerna ERR! npm run build exited 1 in ‘n8n-editor-ui’
#24 302.2 lerna ERR! npm run build exited 1 in ‘n8n-editor-ui’
#24 ERROR: executor failed running [/bin/sh -c npm run build]: exit code: 1

importing cache manifest from secret



[builder 16/16] RUN npm run build:


executor failed running [/bin/sh -c npm run build]: exit code: 1
Exited with code exit status 1

Heyo,
I found out something about the issue again.
It only fails on productionlevel.

RUN npm install --production --loglevel notice
RUN lerna clean
RUN lerna bootstrap --hoist – --production
RUN npm run build

even locally outside of docker, when using those 4 lines locally to build it.

Also, VS Code is pointing out the error in the emitter.ts file (where the error is coming from) without any changes made to it from our side