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

TypeError: Cannot destructure property 'stdout' of 'supportsColor' as it is undefined. #230

Closed
Kamrulhasan12345 opened this issue Oct 7, 2023 · 2 comments

Comments

@Kamrulhasan12345
Copy link

Kamrulhasan12345 commented Oct 7, 2023

I am facing the following issue while trying to use ora in my typescript app:

const {stdout: stdoutColor, stderr: stderrColor} = supportsColor;
               ^


TypeError: Cannot destructure property 'stdout' of 'supportsColor' as it is undefined.
    at <anonymous> (f:\hemel_vai_dl\node_modules\chalk\source\index.js:8:16)
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

What could be the reason of it?

NodeJS version: 18.15
Machine: Windows

Works fine on my bun installation in WSL2, but this problem on windows machine and nodejs itself, idk what's the reason.

@sindresorhus
Copy link
Owner

Make sure your project is ESM.

https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

@Kamrulhasan12345
Copy link
Author

My project is ESM. Maybe I faced issues due to tsconfig things while working with tsm (I don't know exactly). But after transpiling into js, I got that working perfectly. Thanks a lot for the suggestion.

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