Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Hookshot doesn't support experimental type stripping (aka native Typescript support) in Node 23 #1008

Open
Half-Shot opened this issue Jan 17, 2025 · 0 comments
Labels
T-Defect Bugs, crashes, hangs, vulnerabilities, or other reported problems.

Comments

@Half-Shot
Copy link
Contributor

Half-Shot commented Jan 17, 2025

At least, running the tests gives us:

$ yarn test
yarn run v1.22.22
$ mocha -r ts-node/register tests/init.ts 'tests/*.ts'  'tests/**/*.ts'
(node:202632) ExperimentalWarning: Type Stripping is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:202632) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///home/will/git/matrix-hookshot/tests/init.ts is not specified and it doesn't parse as CommonJS.
Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
To eliminate this warning, add "type": "module" to /home/will/git/matrix-hookshot/package.json.
(node:202632) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(node:202632) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.

 Exception during run: SyntaxError[ @/home/will/git/matrix-hookshot/tests/FeedReader.spec.ts ]:   x TypeScript parameter property is not supported in strip-only mode
    ,-[14:1]
 11 | 
 12 | class MockConnectionManager extends EventEmitter {
 13 |     constructor(
 14 |         public connections: IConnection[]
    :                ^^^^^^^^^^^^^^^^^^^^^^^^^^
 15 |     ) {
 16 |         super();
 17 |     }
    `----

    at parseTypeScript (node:internal/modules/typescript:52:11)
    at processTypeScriptCode (node:internal/modules/typescript:98:42)
    at stripTypeScriptModuleTypes (node:internal/modules/typescript:132:10)
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:146:26)
    at defaultGetFormat (node:internal/modules/esm/get_format:209:36)
    at defaultLoad (node:internal/modules/esm/load:119:22)
    at async ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:516:32)
    at async ModuleJob._link (node:internal/modules/esm/module_job:115:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

See https://nodejs.org/docs/latest/api/typescript.html#type-stripping

@Half-Shot Half-Shot added the T-Defect Bugs, crashes, hangs, vulnerabilities, or other reported problems. label Jan 17, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
T-Defect Bugs, crashes, hangs, vulnerabilities, or other reported problems.
Projects
None yet
Development

No branches or pull requests

1 participant