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

Better DX by referring URL link for common or known errors in the terminal #26016

Open
realChakrawarti opened this issue Oct 3, 2024 · 0 comments
Labels
docs suggestion suggestions for new features (yet to be agreed)

Comments

@realChakrawarti
Copy link

realChakrawarti commented Oct 3, 2024

Issue

I have the following code,

import data from './data.json'

console.log(data);

And I get following error as output in the terminal

> deno main.ts

error: Expected a JavaScript or TypeScript module, but identified a Json module. Consider importing Json modules with an import attribute with the type of "json".

Specifier: file:///<path>/data.json
    at file:///<path>/main.ts:1:18

Requested change

I had to search to find the link which shows the solution with an example, https://docs.deno.com/examples/importing-json/ which I expect to be part of the error output in the terminal.

> deno main.ts

error: Expected a JavaScript or TypeScript module, but identified a Json module. Consider importing Json modules with an import attribute with the type of "json".

Refer: https://docs.deno.com/examples/importing-json/

Specifier: file:///<path>/data.json
    at file:///<path>/main.ts:1:18

Could something like this be added for all known errors/warnings. Thanks.

@lucacasonato lucacasonato added docs suggestion suggestions for new features (yet to be agreed) labels Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs suggestion suggestions for new features (yet to be agreed)
Projects
None yet
Development

No branches or pull requests

2 participants