condo icon indicating copy to clipboard operation
condo copied to clipboard

Build Failure After Updating and Attempting to Merge Changes

Open paulo-rossy opened this issue 1 year ago • 5 comments

I recently attempted to update to the latest version and encountered a build failure during the merge process. After running the yarn build command, the build failed with the following error:

@open-condo/miniapp-utils#build: command (/app/packages/miniapp-utils) /tmp/xfs-25ee4603/yarn run build exited (1)
Tasks: 3 successful, 6 total
Cached: 0 cached, 6 total
Time: 1m52.803s
Failed: @open-condo/miniapp-utils#build

ERROR run failed: command exited (1)

It seems to be related to the @open-condo/miniapp-utils package, specifically an issue with an ArrayIterator type not being recognized correctly, as seen in this part of the error:

@open-condo/miniapp-utils:build: Type 'IterableIterator<[number, number]>' is missing the following properties from type 'ArrayIterator<[number, number]>': map, filter, take, drop, and 9 more.

Additionally, there was a Docker build failure at this point:

Dockerfile:64

RUN set -ex \
    && yarn build \
    && rm -rf /app/out \
    && rm -rf /app/.env  \
    && rm -rf /app/.config /app/.cache /app/.docker  \
    && ls -lah /app/

The full error message:

ERROR: process "/bin/sh -c set -ex     && yarn build     && rm -rf /app/out     && rm -rf /app/.env      && rm -rf /app/.config /app/.cache /app/.docker      && ls -lah /app/" did not complete successfully: exit code: 1

Is there any known issue with the @open-condo/miniapp-utils package, or could it be related to a type mismatch in the iterator? Any guidance on resolving this would be greatly appreciated.

paulo-rossy avatar Oct 01 '24 07:10 paulo-rossy

Hello, i'm sorry for the delayed response, but can you please clarify, do you have the problem now? :-) We have had some changes made in miniapps :-(

toplenboren avatar Oct 27 '24 20:10 toplenboren

Hello, i'm sorry for the delayed response, but can you please clarify, do you have the problem now? :-) We have had some changes made in miniapps :-(

@toplenboren, Hello,

Thank you for your response. The previous issue has been resolved, but now I've encountered a new error during the build process. When running yarn build, the build fails with the following error:

#27 692.6 @app/miniapp:build:     at Module.require (node:internal/modules/cjs/loader:1100:19) {
#27 692.6 @app/miniapp:build:   code: 'MODULE_NOT_FOUND',
#27 692.6 @app/miniapp:build:   requireStack: [
#27 692.6 @app/miniapp:build:     '/app/packages/keystone/stitchSchema.js',
#27 692.6 @app/miniapp:build:     '/app/packages/codegen/generate.condo.server.utils.js',
#27 692.6 @app/miniapp:build:     '/app/apps/miniapp/domains/condo/utils/serverSchema/index.js',
#27 692.6 @app/miniapp:build:     '/app/apps/miniapp/domains/condo/utils/access.js',
#27 692.6 @app/miniapp:build:     '/app/apps/miniapp/middlewares/oidc.js',
#27 692.6 @app/miniapp:build:     '/app/apps/miniapp/index.js',
#27 692.6 @app/miniapp:build:     '/app/node_modules/@keystonejs/keystone/bin/commands/build.js',
#27 692.6 @app/miniapp:build:     '/app/node_modules/@keystonejs/keystone/bin/cli.js'
#27 692.6 @app/miniapp:build:   ]
#27 692.6 @app/miniapp:build: }
#27 692.7 @app/miniapp:build: ERROR: command finished with error: command (/app/apps/miniapp) /tmp/xfs-c6b321d6/yarn run build exited (1)
#27 692.8 @app/miniapp#build: command (/app/apps/miniapp) /tmp/xfs-c6b321d6/yarn run build exited (1)
...

I investigated further and found that the modules @graphql-tools/links, @graphql-tools/stitch, and @graphql-tools/wrap imported in packages/keystone/stitchSchema.js are not found. It seems that the error arises due to these missing modules.

I've tried reinstalling dependencies and clearing caches, but the issue persists. Could this be related to a missing or outdated dependency in the package configuration?

Thank you!

paulo-rossy avatar Oct 29 '24 07:10 paulo-rossy

Hi, could you please update your project from our main branch. We've fixed some issue.

pahaz avatar Nov 07 '24 17:11 pahaz

Hi, could you please update your project from our main branch. We've fixed some issue.

@pahaz, Hello!

Yes, the previously reported issues have been fixed, thank you for that! However, there's a new TypeScript error that has come up. I've temporarily ignored it using // @ts-ignore, but I would appreciate it if you could take a look.

The error occurs when running yarn build in packages/miniapp-utils

Here’s the output:

packages/miniapp-utils/src/helpers/uuid.ts

src/hooks/usePrevious.ts → ./dist/cjs/hooks/usePrevious.js, ./dist/esm/hooks/usePrevious.js...
(!) [plugin typescript] @rollup/plugin-typescript TS5069: Option 'declarationDir' cannot be specified without specifying option 'declaration' or option 'composite'.
created ./dist/cjs/hooks/usePrevious.js, ./dist/esm/hooks/usePrevious.js in 2.9s
src/helpers/uuid.ts:15:9 - error TS2322: Type 'Buffer' is not assignable to type 'Uint8Array'.
  The types returned by 'entries()' are incompatible between these types.
    Type 'IterableIterator<[number, number]>' is missing the following properties from type 'ArrayIterator<[number, number]>': map, filter, take, drop, and 9 more.

15         randomValues = randomBytes(16)
           ~~~~~~~~~~~~

Found 1 error in src/helpers/uuid.ts:15.

Thanks for your help!

paulo-rossy avatar Nov 08 '24 12:11 paulo-rossy

Is this problem still happening? It seems that you have not built all the required packages. Could you please refer to the README.md and provide us with the console output.

pahaz avatar Dec 18 '24 15:12 pahaz