Joystream / Joystream/joystream

Current issues with build-packages and the dev toolchain

Open
#5,208 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.4k
Forks
116
PR merge metrics
No merged PRs in 30d

Description

Note: Below output was generated with yarnpkg 4.1 (debian 13.1).

Following the [Development instructions](https://github.com/Joystream/joystream?tab=readme-ov-file#development)

```
./setup.sh --no-volta
# open new terminal

$ yarn build
➤ YN0050: The --frozen-lockfile option is deprecated; use --immutable and/or --immutable-cache instead

...

node:internal/modules/run_main:123
triggerUncaughtException(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'joystream/types/node_modules/.bin/polkadot-types-from-defs' imported from joystream/types/
at finalizeResolution (node:internal/modules/esm/resolve:283:11)
at moduleResolve (node:internal/modules/esm/resolve:952:10)
at defaultResolve (node:internal/modules/esm/resolve:1188:11)
at nextResolve (node:internal/modules/esm/hooks:864:28)
}

Node.js v20.19.2
```

## build-packages.sh fails
`yarn build` calls the root script build-packages.sh which fails at multiple steps, including the above quoted which can be fixed adding a link to `../node_modules` in `types`.
```
joystream$ cd types/
joystream/types$ yarn build

node:internal/modules/run_main:123
triggerUncaughtException(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'joystream/types/node_modules/.bin/polkadot-types-from-defs' imported from joystream/types/

joystream/types$ ln -s ../node_modules/
joystream/types$ yarn build
ERROR: Unable to load user definitions: joystream/types/src/augment/definitions.ts is not a file
joystream/types/src/augment/types.ts
Generating
Writing
...
joystream/types/src/augment/augment-api.ts
Generating
Writing

$ cd ..
$ ./build-packages.sh
➤ YN0050: The --frozen-lockfile option is deprecated; use --immutable and/or --immutable-cache instead
...
ERROR: Unable to load user definitions: joystream/types/src/augment/definitions.ts is not a file
...
ERROR: No custom definitions found: joystream/types/src/augment/definitions.ts is not a file
...
installing jsdoc@^3.6.3
joystream/metadata-protobuf/compiled/index.js updated
joystream/metadata-protobuf/src/json/messages.json updated
joystream/metadata-protobuf/compiled/index.d.ts updated
[1] src/utils/InputOutput.ts(72,37): error TS2339: Property 'dataPath' does not exist on type 'ErrorObject, unknown>'.
src/utils/InputOutput.ts:72:37 - error TS2339: Property 'dataPath' does not exist on type 'ErrorObject, unknown>'.

72 ajv.errors?.map((e) => `${e.dataPath}: ${e.message} (${JSON.stringify(e.params)})`).join('\n')
~~~~~~~~

Found 1 error in src/utils/InputOutput.ts:72

Job [1], 'tsc --project tsconfig.esm.json' has ended
```
This error in `joystreamjs/src/utils/InputOutput.ts` following the `yarn workspace @joystream/js build` step is fixed adding an `any` type:
```
diff --git a/joystreamjs/src/utils/InputOutput.ts b/joystreamjs/src/utils/InputOutput.ts
index 4084befedb..0a934bc969 100644
--- a/joystreamjs/src/utils/InputOutput.ts
+++ b/joystreamjs/src/utils/InputOutput.ts
@@ -69,7 +69,7 @@ export async function validateInput(input: unknown, schema: unknown): Promise `${e.dataPath}: ${e.message} (${JSON.stringify(e.params)})`).join('\n')
+ ajv.errors?.map((e:any) => `${e.dataPath}: ${e.message} (${JSON.stringify(e.params)})`).join('\n')
```
### query node
```
$ yarn workspace query-node-root build
...
src/modules/announcing-period-started-event/announcing-period-started-event.resolver.ts:88:31 - error TS2339: Property 'limit' does not exist on type 'AnnouncingPeriodStartedEventWhereArgs'.

88 @Args() { where, orderBy, limit, offset }: AnnouncingPeriodStartedEventWhereArgs,
~~~~~
src/modules/announcing-period-started-event/announcing-period-started-event.resolver.ts:88:38 - error TS2339: Property 'offset' does not exist on type 'AnnouncingPeriodStartedEventWhereArgs'.

88 @Args() { where, orderBy, limit, offset }: AnnouncingPeriodStartedEventWhereArgs
```
see also #5209

### cli
joystream/metadata-protobuf$ yarn workspace @joystream/cli build

command not found: prettier
...
Fix: `sudo npm i -g prettier` (should be part of the earlier `setup.sh` steps, like ts-node and pm2)

## yarn build:node:docker
```
RUNTIME_PROFILE=TESTING yarn build:node:docker
Error: No such object: joystream/node:9bb9ac54b99d6988c5127046966916681dbb3ffa
Trying to fetch cached joystream/node:9bb9ac54b99d6988c5127046966916681dbb3ffa image
9bb9ac54b99d6988c5127046966916681dbb3ffa: Pulling from joystream/node
7646c8da3324: Pull complete
6a80d2d22569: Pull complete
04064f4e454e: Pull complete
b0f9966c8dc9: Pull complete
5290fe04c6fb: Pull complete
d0c892db8156: Pull complete
fc81f9913c8a: Pull complete
d4cecc8b0fb9: Pull complete
9c2ac76f1eec: Pull complete
4f4fb700ef54: Pull complete
Digest: sha256:d7df9d2654dec3106140e33d00d38cb01e8a279a9e6cdbf112463fff9f608a0f
Status: Downloaded newer image for joystream/node:9bb9ac54b99d6988c5127046966916681dbb3ffa
docker.io/joystream/node:9bb9ac54b99d6988c5127046966916681dbb3ffa
WARNING: The local image's platform amd64 does not match the detected host platform x86_64
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.