Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Docker file builds successfully but raises error "Cannot find module '@activepieces/shared'" when testing/running #4786

Open
coglmn opened this issue May 27, 2024 · 2 comments
Labels
blocked: waiting-response waiting a response from the user

Comments

@coglmn
Copy link

coglmn commented May 27, 2024

Describe the bug

Two Docker file related issues to report:

  1. When the provided Dockerfile is used to build the project using 'docker build' it builds successfully. However, when trying to test/run/deploy, it raises the following error:

node:internal/modules/cjs/loader:1137
throw err;
^

Error: Cannot find module '@activepieces/shared'
Require stack:

  • /usr/src/app/dist/packages/server/api/main.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
    at Module._load (node:internal/modules/cjs/loader:975:27)
    at Module.require (node:internal/modules/cjs/loader:1225:19)
    at require (node:internal/modules/helpers:177:18)
    at moduleId (webpack:///external%20commonjs%20%22@activepieces/shared%22:1:18)
    at r (webpack:///webpack/bootstrap:19:22)
    at moduleId (webpack:///src/app/database/database-connection.ts:1:1)
    at r (webpack:///webpack/bootstrap:19:22)
    at e (webpack:///src/main.ts:1:1)
    at (webpack:///src/main.ts:93:37) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/usr/src/app/dist/packages/server/api/main.js' ]
    }

Node.js v18.19.1

  1. Another observation/question is that PNPM version that is used in the Docker file ([email protected]) does not match the one in package.json ( "pnpm": "8.6.12"). This is maybe an unrelated matter but may create other issues during runtime?

To Reproduce

Building the docker image using a standard build command:

sudo DOCKER_BUILDKIT=1 docker build . -t activcepieces_tag1

it builds successfully

then, running/testing it (it does not make a difference if providing the env file/variables or not):

sudo docker run -it activcepieces_tag1

it raises the reported error.

Expected behavior
To build and run the project successfully using the provided Docker file.

Screenshots
Can be replicated using the above command lines.

Additional context
None.

@abuaboud
Copy link
Contributor

Hii @coglmn

Can you try it with at least these environment variables defined here:

https://www.activepieces.com/docs/install/options/docker

and replace the docker image with your tag offline, let me know if that fixes the issue.

@abuaboud abuaboud added the blocked: waiting-response waiting a response from the user label May 28, 2024
@coglmn
Copy link
Author

coglmn commented May 28, 2024

Thank you, @abuaboud. I ran it with the environment variables defined in that page. It raises the same error and does not run (removing -d below to see the error):

sudo docker run -p 8080:80 -v ~/.activepieces:/root/.activepieces -e AP_QUEUE_MODE=MEMORY -e AP_DB_TYPE=SQLITE3 -e AP_FRONTEND_URL="http://localhost:8080" docker_image_tag

Console output:

node:internal/modules/cjs/loader:1137
throw err;
^

Error: Cannot find module '@activepieces/shared'
Require stack:

  • /usr/src/app/dist/packages/server/api/main.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
    at Module._load (node:internal/modules/cjs/loader:975:27)
    at Module.require (node:internal/modules/cjs/loader:1225:19)
    at require (node:internal/modules/helpers:177:18)
    at moduleId (webpack:///external%20commonjs%20%22@activepieces/shared%22:1:18)
    at r (webpack:///webpack/bootstrap:19:22)
    at moduleId (webpack:///src/app/database/database-connection.ts:1:1)
    at r (webpack:///webpack/bootstrap:19:22)
    at e (webpack:///src/main.ts:1:1)
    at (webpack:///src/main.ts:93:37) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/usr/src/app/dist/packages/server/api/main.js' ]
    }

Node.js v18.19.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: waiting-response waiting a response from the user
Projects
None yet
Development

No branches or pull requests

2 participants