Open ChristopherHarwell opened 8 months ago
Awesome Issue. Very thorough. Thanks!
After our discussion, I believe you needed to run pnpm install from the project root rather than the js client folder. This is because pnpm needs to link dependencies within the workspace.
The Hasher bug, was definitely just a bug from a previous refactor that we missed. It should be updated and fixed once I merge my start-end-fix branch.
Let me know if you get it working with the top level install. If not, happy to troubleshoot it more.
So after running pnpm install
from the top level, it seems I am still running into the @Vexilla/types
missing compilation error in the JS SDK.
I can provide more info tomorrow once I have some more time to look into why that might be happening. Haven't worked on trying to fix it in a few days. But plan on trying to get this working this weekend.
I think this was related to the missing .env file. Could you try removing the whole thing, recloning, and then reinstalling before a recompile?
I also just pushed up some changes that fix the Hasher problems:
Additionally, there are errors related to module imports from /src/hasher, specifically stating that the module has no default export (generate_gradual_uuid.ts, generate_seed_for_uuid.ts, test_distribution.ts). This implies a potential mismatch between the exported and imported entities in these modules.
Prerequisites
Description
When attempting to compile the TypeScript project using the
pnpm compile
command within our Vexilla client setup, we encounter several compilation errors that seem to stem from missing module declarations and incorrect module exports. Below are the details of the errors received during compilation:Multiple errors indicate the absence of type declarations for
@vexilla/types
. TypeScript is unable to find the module '@vexilla/types' or its corresponding type declarations in various files (client.ts
,scheduling.ts
,test_client.ts
,test_distribution.ts
,test_scheduling.ts
,utils/lookup_tables.ts
). This suggests that either the@vexilla/types
package is not installed, or the TypeScript configuration does not correctly reference the types.Additionally, there are errors related to module imports from
/src/hasher
, specifically stating that the module has no default export (generate_gradual_uuid.ts
,generate_seed_for_uuid.ts
,test_distribution.ts
). This implies a potential mismatch between the exported and imported entities in these modules.When running the
pnpm test
andpnpm test:scheduling
commands in the context of our Vexilla JavaScript client setup, we encounter a situation mirroring the issues faced during thepnpm compile
process, but with additional implications for our testing workflow. These commands are designed to execute unit tests to verify the integrity and functionality of our codebase, but the presence of compilation errors obstructs this essential verification process.The errors encountered are twofold and closely resemble those observed during compilation:
Missing Type Declarations for
@vexilla/types
: Similar to the compilation phase, when attempting to run tests, TypeScript reports an inability to locate the module@vexilla/types
or its corresponding type declarations across multiple files. This issue is prevalent in files such asclient.ts
,scheduling.ts
,test_client.ts
,test_distribution.ts
,test_scheduling.ts
, andutils/lookup_tables.ts
. The repeated occurrence of this error in the testing phase underscores a possible systemic issue with how the@vexilla/types
package is integrated or referenced within the project, suggesting a critical need for revisiting the package installation or TypeScript's configuration setup to ensure proper recognition of type declarations.Incorrect Module Exports from
/src/hasher
: The tests also fail due to errors concerning module imports, particularly pointing out that thesrc/hasher
module does not have a default export. This problem is highlighted in files likegenerate_gradual_uuid.ts
,generate_seed_for_uuid.ts
, andtest_distribution.ts
. This indicates a discrepancy between the expectation of default exports within the consuming files and the actual export structure of thesrc/hasher
module, hinting at a misalignment in the export/import statements that needs to be corrected for successful test execution.The culmination of these errors during the test execution phase (
pnpm test
andpnpm test:scheduling
) not only halts the testing process but also raises concerns about the project's current state of modularity and type-safety. It highlights a critical barrier to maintaining code quality and reliability, as the inability to run tests due to compilation errors prevents validation of code changes and the assurance of functionality through automated testing. Addressing these issues is paramount to resuming a productive development and testing cycle, ensuring that the Vexilla JavaScript client adheres to expected standards of quality and robustness.The exact error message for
pnpm compile
are as follows:The exact error message for
pnpm test
are as follows:The exact error message for
pnpm test:scheduling
are as follows:This issue has halted our development process as we cannot proceed without resolving these compilation errors. It seems that there might be a need for clearer documentation on the setup or perhaps an update to ensure that the necessary type declarations and module exports are correctly defined and available. Any assistance or guidance on resolving these errors would be greatly appreciated.
Steps to Reproduce
To reproduce the TypeScript compilation issue encountered with the Vexilla client, follow these detailed steps:
Start the Test Server:
Replace
/path/to/vexilla
with the actual path to your Vexilla project.Run the JS Client Tests:
Again, replace
/path/to/vexilla
with the actual path to your Vexilla project.Run the JS Client Tests for scheduling:
Again, replace
/path/to/vexilla
with the actual path to your Vexilla project.Run the TypeScript Compilation script for the JS Client:
Again, replace
/path/to/vexilla
with the actual path to your Vexilla project.@vexilla/types
.By following these steps, you should encounter the specific TypeScript compilation errors previously mentioned, indicating issues with missing type declarations and incorrect module export/import usage within the Vexilla JavaScript client project.
Expected behavior: Upon navigating to the appropriate directory and starting the test server located at
vexilla/packages/test
with thepnpm start
command, followed by runningpnpm test
from another terminal in the JavaScript client directory atvexilla/clients/js
, the expected behavior is that all tests should execute successfully without any compilation errors.Actual behavior: The actual behavior observed when attempting to run tests for the Vexilla JavaScript client is a series of compilation errors that prevent the execution of the tests. Upon navigating to the Vexilla JS client directory and executing
pnpm test
, TypeScript compilation fails with multiple errors. These errors primarily concern missing module declarations for@vexilla/types
across various files and issues with module imports, notably from thesrc/hasher
module, which is reported to lack a default export. This results in the test command exiting with an error code (ELIFECYCLE Command failed with exit code 2), indicating that the tests cannot be run as expected due to these compilation issues.Environment
Additional Context
Output of running
pnpm test
:Output of running
pnpm test:scheduling
:Output of running
pnpm compile
:node
,pnpm
, andnpm
versions: