N8n-node-dev build issue with a file

Hello everybody!

I am facing certain issue when trying to build a custom node which need some classess I made. When I run the command, all files are built and copied to the n8n/custom folder except of one. Do you know why can this be happening?

Thank you so much

Hey @adricampi!

Can you share some more information? Do you get any errors for that file? What does your file structure look like?

Hi @harshil1712
I don’t get any error. All the process ends perfectly, but this class doesn’t get build
It’s a simple class which mades GET POST PUT and DELETE requests.
The class tries to imitate a session class

Maybe @ivov or @RicardoE105 can you help you here.

Without further context, maybe your filename does not match the tsconfig glob pattern.

1 Like

The problem is not with the *.node.ts
is just with different files (classess) which are needed by the node to work for example session.ts

That is not supported. Everything has to be in that one node file. If you want to build more complex nodes, you should look into creating an own n8n node module like this example one:

As Jan explained, this is not supported. But if you are looking to experiment, my message was about including in tsconfig the file that is not being transpiled because its glob pattern does not match.

Thank you very much for your answer @jan .
In this case, if I create a node module, would I be able to run it in the same docker where I have my custom nodes?

Thanks

Yes that is possible but you would then have to build your own docker image. One that extends the n8n base one and additionally installs your nodes.

The Dockerfile would then look like this:

FROM n8nio/n8n:latest

RUN npm install -g your-custom-node-module

You can build it with:

docker build -t my-custom-image .

Perfect, I have already build my own docker image. So the only thing I need to do is to copy the custom node module to the custom folder on the docker folder, right?

Thank you very much