Type 'unknown' cannot be used as an index type
See original GitHub issueDescribe the bug In certain builds, when we try to run start.sh, the local stack fails to come up with the following error: Type ‘unknown’ cannot be used as an index type (in line 63 in WinnowingPreprocessingService.ts).
When @sophiewu6 tried running a local stack, this error prevented the stack from coming up, whereas I can bring my stack up fine. (We both use MacOS 10.14.5) I also see the same error in my Sublime Text editor (which has a Typescript compiler attached). So looks like the typescript error is not blocking my stack from coming up, but its blocking @sophiewu6’s stack.
To Reproduce Steps to reproduce the behavior: Merge upstream/develop Run bash scripts/start.sh
Observed behavior Local stack doesn’t come up
Expected behavior Local stack should come up
Screenshots
Desktop (please complete the following information; delete this section if the issue does not arise on desktop):
- OS: MacOS 10.14.5
- Browser Chrome
- Version 74.0.3729.169
Additional context
Note: As a temporary fix for this problem you can change line 62 of WinnowingPreprocessingService.ts to
fingerprintHashesIndex.forEach(function(hashIndex: number) {
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (9 by maintainers)
Top GitHub Comments
options[value as number] or options[value as any] should sort the issue
Hey folks, if you’re running into issues somewhat like these, please look into the following points from the wiki https://github.com/oppia/oppia/wiki/Guide-on-defining-types#ts-8 https://github.com/oppia/oppia/wiki/Guide-on-defining-types/#ts-4