Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Use node 22.x --experimental-strip-types instead of tsx to run scripts #930

Closed
wants to merge 2 commits into from

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Aug 7, 2024

Issue

https://nodejs.org/en/blog/release/v22.6.0#experimental-typescript-support-via-strip-types

Description

Attempts to use node 22.x --experimental-strip-types instead of tsx to run scripts

Testing

Discontinued, since imports require *.ts extension

$ yarn generate:tests
(node:32889) 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:32889) [MODULE_TYPELESS_PACKAGE_JSON] Warning: file:///Users/trivikram/workspace/aws-sdk-js-codemod/scripts/generateNewClientTests/index.ts parsed as an ES module because module syntax was detected; to avoid the performance penalty of syntax detection, add "type": "module" to /Users/trivikram/workspace/aws-sdk-js-codemod/package.json
node:internal/modules/esm/resolve:257
    throw new ERR_MODULE_NOT_FOUND(
          ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/trivikram/workspace/aws-sdk-js-codemod/scripts/generateNewClientTests/getGlobalImportEqualsInput' imported from /Users/trivikram/workspace/aws-sdk-js-codemod/scripts/generateNewClientTests/index.ts
    at finalizeResolution (node:internal/modules/esm/resolve:257:11)
    at moduleResolve (node:internal/modules/esm/resolve:914:10)
    at defaultResolve (node:internal/modules/esm/resolve:1039:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:554:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:523:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:246:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:126:49) {
  code: 'ERR_MODULE_NOT_FOUND',
  url: 'file:///Users/trivikram/workspace/aws-sdk-js-codemod/scripts/generateNewClientTests/getGlobalImportEqualsInput'
}

Node.js v22.6.0

It can be retried if codemod is converted to ESM in future, and when the strip-types support gets stable.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

changeset-bot bot commented Aug 7, 2024

⚠️ No Changeset found

Latest commit: 91a8ed4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@trivikr trivikr closed this Aug 7, 2024
@trivikr trivikr deleted the node-experimental-strip-types branch August 7, 2024 16:38
@trivikr trivikr restored the node-experimental-strip-types branch August 7, 2024 16:44
@trivikr trivikr deleted the node-experimental-strip-types branch August 7, 2024 16:53
Copy link
Contributor

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant