-
Notifications
You must be signed in to change notification settings - Fork 10
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
[Bug]: aws-sdk-js-codemod doesn't work for me unless I use an absolute path #478
Comments
I'm not able to reproduce this locally on MacOS. My system info: System:
OS: macOS 12.6.3
CPU: (10) arm64 Apple M1 Pro
Memory: 101.27 MB / 32.00 GB
Shell: 5.8.1 - /bin/zsh Commands run: $ cat input.js
import { ACM } from "aws-sdk";
new ACM();
$ npx aws-sdk-js-codemod -t v2-to-v3 input.js
Processing 1 files...
Spawning 1 workers...
Sending 1 files to free worker...
All done.
Results:
0 errors
0 unmodified
0 skipped
1 ok
Time elapsed: 0.266seconds
$ cat input.js
import { ACM } from "@aws-sdk/client-acm";
new ACM(); I see that your logs have the following errors: Skipping path loadfromddb.ts which does not exist. The codemod is not able to find your file. Can you What's the output of running |
For future reference, this is likely an issue with jscodeshift. Source code which writes the error: |
Yes, it exists in the folder. There are no symlinks. I just replicated your test here: Ensure the file is there:
Looks like I'm missing a few OS updates, will do them now to see if it helps at all. |
Same issue, really odd.
|
Is the issue reproducible if you use JSCodeShift directly? $ npx jscodeshift -t ~/.npm/_npx/<tmp>/node_modules/aws-sdk-js-codemod/dist/transforms/v2-to-v3/transformer.js input.js where The above commands calls jscodeshift directly, and passes just the |
It looks like it:
|
Can you create bug report on jscodeshift, and reference this issue? |
Will do, thank you for the help! |
Closing as this issue would be followed up upstream facebook/jscodeshift#554 |
I wasn't able to reproduce the issue. Can someone create a temporary git repository with the simplest-possible case of the issue happening? |
The issue appears to be any transformer, and not specific to aws-sdk-js-codemod. From the latest update in facebook/jscodeshift#554 (comment), it looks like jscodeshift is not able to read relative URLs, and also the ones which start with Source code in jscodeshift which writes the error: |
I haven’t been able to reproduce the behavior, even when testing with multiple levels of symlinks and relative dirs including ~/.npm.Trivkram, have you been able to reproduce the problem yet?Sent from my iPhoneOn Mar 25, 2023, at 15:03, Trivikram Kamat ***@***.***> wrote:
Can someone create a temporary git repository with the simplest-possible case of the issue happening?
The issue appears to be any transformer, and not specific to aws-sdk-js-codemod.
From the latest update in facebook/jscodeshift#554 (comment), it looks like jscodeshift is not able to read relative URLs, and also the ones which start with ~/.npm.
Source code in jscodeshift which writes the error:
https://github.com/facebook/jscodeshift/blob/a763c4fa7b7680721c5fa1ad9dce81cae38c3d39/src/Runner.js#L115-L119
https://github.com/facebook/jscodeshift/blob/a763c4fa7b7680721c5fa1ad9dce81cae38c3d39/src/Runner.js#L140-L144
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
No. My original repro attempt had failed in #478 (comment). Then I'd provided tips in #478 (comment) to check if issue is in jscodeshift, which @xelfer attempted. |
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. |
Self-service
Describe the bug
aws-sdk-js-codemod doesn't work for me unless I use an absolute path. It claims the path does not exist.
Steps to reproduce
I ran the command as advised in documentation
Observed behavior
The command did not work unless I specified the full system path.
Expected behavior
The command should work using relative paths.
Environment
Additional context
I'm using default zsh in a visual studio code terminal on an Apple MacBook M1 Max running macOS Monterey 12.1.
The text was updated successfully, but these errors were encountered: