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

Error when used in CI/CD #53

Open
cerbaire opened this issue Aug 25, 2023 · 3 comments
Open

Error when used in CI/CD #53

cerbaire opened this issue Aug 25, 2023 · 3 comments

Comments

@cerbaire
Copy link

When running tspath in a CI/CD script, I have the following error:

npx tspath -f -s
TSPath v2.6.8
Try: 'tspath --help' for more information
Parsing project: my-project /opt/gitlab-runner/builds/xxx/yyy/packages/my-project/
Indexing files...
/opt/gitlab-runner/builds/xxx/yyy/node_modules/tspath/utils/utils.js:64
process.stdout.clearLine();
^
TypeError: process.stdout.clearLine is not a function
at Function.updateLine (/opt/gitlab-runner/builds/xxx/yyy/node_modules/tspath/utils/utils.js:64:24)
at ParserEngine.walkSync (/opt/gitlab-runner/builds/xxx/yyy/node_modules/tspath/parser-engine.js:438:31)
at ParserEngine.walkSync (/opt/gitlab-runner/builds/xxx/yyy/node_modules/tspath/parser-engine.js:435:33)
at ParserEngine.walkSync (/opt/gitlab-runner/builds/xxx/yyy/node_modules/tspath/parser-engine.js:435:33)
at ParserEngine. (/opt/gitlab-runner/builds/xxx/yyy/node_modules/tspath/parser-engine.js:148:18)
at Generator.next ()
at /opt/gitlab-runner/builds/xxx/yyy/node_modules/tspath/parser-engine.js:31:71
at new Promise ()
at __awaiter (/opt/gitlab-runner/builds/xxx/yyy/node_modules/tspath/parser-engine.js:27:12)
at ParserEngine.execute (/opt/gitlab-runner/builds/xxx/yyy/node_modules/tspath/parser-engine.js:112:16)

I can reproduce the same error local using the following command:
npx tspath -f -s > debug.log

I don't see any difference on console output when using -s parameter.

Any idea?

Thanks for your support

@The-White-Fang
Copy link

Did you manage to fix it? I am encountering the same error.

@The-White-Fang
Copy link

For anyone who is looking for a solution to this.
Use patch-package to patch tspath

Step 1: Install patch-package by npm i patch-package
Step 2: Make changes to node_modules/tspath/utils/utils.js and node_modules/tspath/parser-engine.js
Step 3: Run npx patch-package tspath
Step 4: Commit the changes.
Step 5: Add a docker step after npm i, npx patch-package.
Step 6: Purge build cache docker system prune -a and rebuild the image.

@cerbaire
Copy link
Author

cerbaire commented Nov 2, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants