Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the 4 remaining
tscerrors reported by the TypeScript job, all of them insidematrix-js-sdk.Add
@matrix-org/matrix-sdk-crypto-wasm@^18.3.1(the version range the pinned SDK asks for) as a devDependency ofapps/web. The change is one line inapps/web/package.jsonand six lines inpnpm-lock.yaml. No source code changes.Root cause
apps/web/tsconfig.jsonincludes./node_modules/matrix-js-sdk/src/@types/*.d.tsthrough the symlinked path. That declaration file doesimport type * as RustSdkCryptoJs from "@matrix-org/matrix-sdk-crypto-wasm".Because the file is read through
apps/web/node_modules, TypeScript resolves that import fromapps/web. pnpm only links an app's direct dependencies there, and@matrix-org/matrix-sdk-crypto-wasmis only a dependency of the SDK, so it is not visible andtscfails withTS2307: Cannot find module. The three other errors inMSC4108SignInWithQR.ts(TS2312,TS2698,TS2322) follow from it, because the types from that package becomeunknown.Things that were ruled out: the package is installed (18.3.1), it is linked into the SDK's own folder, and
moduleResolutionis alreadybundler.Verification
tsc --noEmitinapps/web: 4 errors before, 0 after.pnpm -r --workspace-concurrency=1 lint:types(the command the CI uses) passes.Notes
fix-remove-layered-build-step(the SDK pin, ci: pin matrix-js-sdk to lockfile commit to avoid layered.sh clone #24), since the pin is what exposed the problem. It should be merged together with or after ci: pin matrix-js-sdk to lockfile commit to avoid layered.sh clone #24.olminclude inapps/web/playwright/tsconfig.json). Instead of resolving olm's types by package name, I removed the line:olmis not installed at all with the pinned SDK (node_modules/.pnpmhas no olm package) andtsc -p playwright/tsconfig.jsonreports 0 errors before and after, so nothing needs those types. Happy to switch to thepaths/typesapproach if you prefer.