mirror of
https://github.com/denoland/deno.git
synced 2025-08-08 04:48:14 +00:00
fix(run): skip the cjs suggestion for mjs/mts modules (#26698)
Co-authored-by: David Sherret <dsherret@gmail.com>
This commit is contained in:
parent
2ddaafd762
commit
64a4003487
5 changed files with 28 additions and 0 deletions
|
@ -309,6 +309,13 @@ fn get_suggestions_for_terminal_errors(e: &JsError) -> Vec<FixSuggestion> {
|
|||
|| msg.contains("exports is not defined")
|
||||
|| msg.contains("require is not defined")
|
||||
{
|
||||
if let Some(file_name) =
|
||||
e.frames.first().and_then(|f| f.file_name.as_ref())
|
||||
{
|
||||
if file_name.ends_with(".mjs") || file_name.ends_with(".mts") {
|
||||
return vec![];
|
||||
}
|
||||
}
|
||||
return vec![
|
||||
FixSuggestion::info_multiline(&[
|
||||
cstr!("Deno supports CommonJS modules in <u>.cjs</> files, or when the closest"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue