我正在将一个应用程序从 React 移植到 Next,但我的 css 一直出现错误:“ul”不是纯的(纯选择器必须至少包含一个本地类或 id)。
我正在使用 css 模块,但不确定将所有内容保留在 css 模块中的解决方法。
例如:
索引.js
<div className={styles.container}>
<ul>
<li>Person One</li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
index.module.css
.container{
background-color: pink;
}
ul{
list-style-type: none; //this throws an error
}
Run Code Online (Sandbox Code Playgroud) 我正在 Gatsby 中创建动态页面,从 Fauna 中提取数据。我在 gastby-node 中有一个查询,该查询抛出错误“必须提供源”,但该查询在 GraphiQL 中有效。我在下面包含了 gatsby-node.js。
exports.createPages = async function({actions, graphql}){
const {data} = await graphql`
query {
fauna {
allCompanies {
data {
slug
}
}
}
}
`
data.fauna.allCompanies.data.forEach(edge => {
const slug = edge.slug
actions.createPages({
path: slug,
component: require.resolve("./src/components/products.js"),
context:{
slug
},
})
})
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试全局安装 gatsby-cli:
npm install -g gatsby-cli
Run Code Online (Sandbox Code Playgroud)
我不断收到访问错误,但不知道如何解决。