当我在 Chrome 开发工具中打开控制台时,我可以看到一些控制台消息为灰色文本,另一些消息为普通文本。为什么有些控制台消息是灰色的?
我正在使用 Chrome 开发工具使用 React 和调试我的应用程序,主要是通过Typescript 中的console.log方法。
我的研究 我发现我的线程解释了如何为控制台消息设置颜色。但这不是我想要的。
我的问题 我想知道为什么控制台中的某些消息是灰色的。
概述
要求
目前的实施
{<Grid container>
{rowArray.map(x => (
<>
<Grid item>"Fixed Item"</Grid>
{columnArray.map(x => (
<Grid item>Dynamic items</Grid>
))}
</>
))}
</Grid>}
Run Code Online (Sandbox Code Playgroud) 我是 NodeJS 的初学者。我试图导入一个模块,fs.readFileSync
我按照 NodeJS 文档使用 import { readFileSync } from 'fs' ,但我不断收到以下错误,
错误----->>SyntaxError: Cannot use import statement outside a module
我的研究
->我发现添加type:module文件package.json可以解决这个问题。
我的疑问
->我想知道为什么不能按照文档导入?
代码
import { readFileSync } from 'fs';
fs.writeFileSync('notes.txt','This was read by NodeJS')
Run Code Online (Sandbox Code Playgroud)
完全错误
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1031:15)
at Module._compile (node:internal/modules/cjs/loader:1065:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
Run Code Online (Sandbox Code Playgroud)