想了解gatsbybuild不包含来自css库的svg图标的新动态吗?本文将为您提供详细的信息,我们还将为您解答关于不包含actionscript的相关问题,此外,我们还将为您介绍关于'gatsby-
想了解gatsby build 不包含来自 css 库的 svg 图标的新动态吗?本文将为您提供详细的信息,我们还将为您解答关于不包含actionscript的相关问题,此外,我们还将为您介绍关于'gatsby-source-graphql' 导致加载插件错误引用 'gatsby/graphql' 我将它包含在我的 gatsby-config.js 中,如下所示:但它产生了这个错误:我尝试过的:我使用 gatsby info --clipboard 的环境报告是:有什么想法吗?导致问题的原因如下:、的新知识。
本文目录一览:- gatsby build 不包含来自 css 库的 svg 图标(不包含actionscript)
- 'gatsby-source-graphql' 导致加载插件错误引用 'gatsby/graphql' 我将它包含在我的 gatsby-config.js 中,如下所示:但它产生了这个错误:我尝试过的:我使用 gatsby info --clipboard 的环境报告是:有什么想法吗?导致问题的原因如下:
- 或
都不是在 iphone 中动画">
- div+css 之 CSS 文本设置 CSS 字体设置 CSS 列表设置 CSS 表格设置 css outline 轮廓
- Gatsby (gatsby-source-strapi) - 您的数据问题中存在冲突的字段类型
gatsby build 不包含来自 css 库的 svg 图标(不包含actionscript)
如何解决gatsby build 不包含来自 css 库的 svg 图标
我正在使用 flag-icons SVG 图标包,它在开发模式下运行良好,但是当我构建站点时,生产中缺少图标。
在我的 React 组件中,我像这样导入库
import ''flag-icon-css/css/flag-icon.css'';
然后只需为标志图标使用适当的 CSS 类。
'gatsby-source-graphql' 导致加载插件错误引用 'gatsby/graphql' 我将它包含在我的 gatsby-config.js 中,如下所示:但它产生了这个错误:我尝试过的:我使用 gatsby info --clipboard 的环境报告是:有什么想法吗?导致问题的原因如下:
如何解决''gatsby-source-graphql'' 导致加载插件错误引用 ''gatsby/graphql'' 我将它包含在我的 gatsby-config.js 中,如下所示:但它产生了这个错误:我尝试过的:我使用 gatsby info --clipboard 的环境报告是:有什么想法吗?导致问题的原因如下:
我已经添加了一个可用的 Gatsby 安装,但是,在尝试构建一些 graphQL 构建时数据获取时,我遇到了一个问题,该问题导致错误运行 npm start (gatsby develop) 或 gatsby build。
我按照此处的说明安装了 gatsby-source-graphql: https://www.npmjs.com/package/gatsby-source-graphql
我将它包含在我的 gatsby-config.js 中,如下所示:
module.exports = {
// Optional
siteMetadata: {
title: `Title from siteMetadata`,},plugins: [
{
resolve: `gatsby-plugin-manifest`,options: {
name: "Project Template",short_name: "PT",start_url: "/",background_color: "#6b37bf",theme_color: "#6b37bf",// Enables "Add to Homescreen" prompt and disables browser UI (including back button)
// see https://developers.google.com/web/fundamentals/web-app-manifest/#display
display: "standalone",icon: "src/images/icon.png",// This path is relative to the root of the site.
// An optional attribute which provides support for CORS check.
// If you do not provide a crossOrigin option,it will skip CORS for manifest.
// Any invalid keyword or empty string defaults to `anonymous`
crossOrigin: `use-credentials`,{
resolve: `gatsby-source-filesystem`,options: {
name: `images`,path: `${__dirname}/src/images`,// GraphQL APIs for use during build-time.
// https://www.npmjs.com/package/gatsby-source-graphql
//////////////////////////////////////////////////////
{
resolve: "gatsby-source-graphql",options: {
// Arbitrary name for the remote schema Query type
typeName: "SpaceX",// Field under which the remote schema will be accessible. You''ll use this in your Gatsby query
fieldName: "spaceX",// Url to query from
url: "https://api.spacex.land/graphql/",// {
// resolve: "gatsby-source-graphql",// options: {
// // Arbitrary name for the remote schema Query type
// typeName: "SWAPI",// // Field under which the remote schema will be accessible. You''ll use this in your Gatsby query
// fieldName: "swapi",// // Url to query from
// url: "https://swapi-graphql.netlify.app/.netlify/functions/index",// },// },`gatsby-transformer-sharp`,`gatsby-plugin-sharp`,`gatsby-plugin-react-helmet`,`gatsby-theme-material-ui`,{
resolve: `gatsby-plugin-nprogress`,options: {
// Setting a color is optional.
color: `tomato`,// disable the loading spinner.
showSpinner: false,`gatsby-plugin-transition-link`,`gatsby-plugin-layout`,// Trial and error showed this needs to be last (But that doesn''t mean it will always work in the dev environment,try npm run clean or if that fails - test in build)
],}
但它产生了这个错误:
Error in "/Users//Documents/projects/project/node_modules/gatsby-source-graphql/gatsby-node.js":
Cannot find module ''gatsby/graphql''
Error: Cannot find module ''gatsby/graphql''
- loader.js:636 Function.Module._resolveFilename
internal/modules/cjs/loader.js:636:15
- loader.js:562 Function.Module._load
internal/modules/cjs/loader.js:562:25
- loader.js:692 Module.require
internal/modules/cjs/loader.js:692:17
- v8-compile-cache.js:159 require
[client]/[v8-compile-cache]/v8-compile-cache.js:159:20
- gatsby-node.js:8 Object.<anonymous>
[tbwa-project-template]/[gatsby-source-graphql]/gatsby-node.js:8:5
- v8-compile-cache.js:178 Module._compile
[client]/[v8-compile-cache]/v8-compile-cache.js:178:30
- loader.js:789 Object.Module._extensions..js
internal/modules/cjs/loader.js:789:10
- loader.js:653 Module.load
internal/modules/cjs/loader.js:653:32
- loader.js:593 tryModuleLoad
internal/modules/cjs/loader.js:593:12
- loader.js:585 Function.Module._load
internal/modules/cjs/loader.js:585:3
- loader.js:692 Module.require
internal/modules/cjs/loader.js:692:17
- v8-compile-cache.js:159 require
[client]/[v8-compile-cache]/v8-compile-cache.js:159:20
- resolve-module-exports.ts:197 resolveModuleExports
[client]/[gatsby]/src/bootstrap/resolve-module-exports.ts:197:26
- validate.ts:348 forEach
[client]/[gatsby]/src/bootstrap/load-plugins/validate.ts:348:31
- Array.forEach
- validate.ts:340 collatePluginAPIs
[client]/[gatsby]/src/bootstrap/load-plugins/validate.ts:340:20
not finished load plugins - 0.727s
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! project-template@1.0.0 start: `gatsby develop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the project-template@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/_logs/2021-02-04T00_31_34_070Z-debug.log
我尝试过的:
-
我在配置中尝试了两种不同的 gatsby-source-graphql 定义(一次只有一种),但都产生了错误。第二个(上面已注释掉)直接取自 The github page example 和 Gatsby example。
-
我已经尝试更改插件的顺序(我已经尝试了所有位置),但仍然出现错误。
-
如果我在配置中评论任何和所有 gatsby-source-graphql 部分,它不会产生错误。
-
如果我注释掉所有插件除了 gatsby-source-graphql 部分之一,我仍然得到完全相同的错误。
-
我也试过删除 node_modules 文件夹,运行 npm run clean,然后再次 npm install 没有任何变化。
-
我也尝试了以下链接中描述的 DanceParty 解决方案,没有任何变化: https://github.com/gatsbyjs/gatsby/issues/8249
-
我试过运行
npm update
和npm install npm@latest -g
,但没有看到任何变化。
我使用 gatsby info --clipboard 的环境报告是:
System:
OS: macOS 10.15.7
cpu: (4) x64 Intel(R) Core(TM) i5-6287U cpu @ 3.10GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 10.23.1 - /usr/local/bin/node
npm: 6.14.10 - /usr/local/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
browsers:
Chrome: 88.0.4324.96
Firefox: 85.0
Safari: 14.0.2
npmPackages:
gatsby: ^2.26.1 => 2.32.0
gatsby-image: ^2.10.0 => 2.11.0
gatsby-plugin-layout: ^1.9.0 => 1.10.0
gatsby-plugin-manifest: ^2.11.0 => 2.12.0
gatsby-plugin-material-ui: ^2.1.10 => 2.1.10
gatsby-plugin-nprogress: ^2.9.0 => 2.10.0
gatsby-plugin-react-helmet: ^3.8.0 => 3.10.0
gatsby-plugin-sharp: ^2.13.0 => 2.14.0
gatsby-plugin-transition-link: ^1.20.5 => 1.20.5
gatsby-source-filesystem: ^2.10.0 => 2.11.0
gatsby-theme-material-ui: ^1.0.13 => 1.0.13
gatsby-transformer-sharp: ^2.11.0 => 2.12.0
npmGlobalPackages:
gatsby-cli: 2.19.0
有什么想法吗?
解决方法
我开始创建一个最小的复制品,然后将所有内容一个一个地添加回去,但我决定在我的第一个设置中玩得更多一些......我很高兴我做到了。
导致问题的原因如下:
此 Gatsby 安装是我们使用的项目模板的一部分,其中包括后端代码、前端、管道部署脚本等。 结构类似于:
ProjectTemplate 文件夹
- 客户端文件夹
- 服务器文件夹
- 其他文件夹
Gatsby 安装位于客户端文件夹中,但有时我需要进入根文件夹执行某些操作。
所以发生了什么事!?我不小心将 gatsby-source-graphql
安装到根文件夹而不是客户端文件夹。就这样。
我应该在运行 gatsby info --clipboard
时选择它,因为它显然没有列为依赖项。
或
都不是在 iphone 中动画" alt="
或
都不是在 iphone 中动画">
如何解决<object type="image/svg+xml" data="images/loader.svg"> 或 <img src="images/loader.svg" alt="" /> 都不是在 iphone 中动画
我使用了两个标签,但都不适用于 iphone 意味着 svg 在 iphone 中没有动画
<object type="image/svg+xml" data="images/loader.svg">
或
<img src="images/loader.svg" alt="" />
div+css 之 CSS 文本设置 CSS 字体设置 CSS 列表设置 CSS 表格设置 css outline 轮廓
1、CSS 文本设置:
CSS 文本属性
属性 描述
color 设置文本颜色
direction 设置文本方向。
line-height 设置行高。
letter-spacing 设置字符间距。
text-align 对齐元素中的文本。
text-decoration 向文本添加修饰。
text-indent 缩进元素中文本的首行。
text-shadow 设置文本阴影。CSS2 包含该属性,但是 CSS2.1 没有保留该属性。
text-transform 控制元素中的字母。
unicode-bidi 设置文本方向。
white-space 设置元素中空白的处理方式。
word-spacing 设置字间距。
2、CSS 字体设置:
CSS 字体属性
属性 描述
font 简写属性。作用是把所有针对字体的属性设置在一个声明中。
font-family 设置字体系列。
font-size 设置字体的尺寸。
font-size-adjust 当首选字体不可用时,对替换字体进行智能缩放。(CSS2.1 已删除该属性。)
font-stretch 对字体进行水平拉伸。(CSS2.1 已删除该属性。)
font-style 设置字体风格。
font-variant 以小型大写字体或者正常字体显示文本。
font-weight 设置字体的粗细。
3、CSS 列表设置:
CSS 列表属性 (list)
属性 描述
list-style 简写属性。用于把所有用于列表的属性设置于一个声明中。
list-style-image 将图象设置为列表项标志。
list-style-position 设置列表中列表项标志的位置。
list-style-type 设置列表项标志的类型。
marker-offset
列表项图像
有时,常规的标志是不够的。你可能想对各标志使用一个图像,这可以利用 list-style-image 属性做到:
ul li {list-style-image : url(xxx.gif)}
只需要简单地使用一个 url () 值,就可以使用图像作为标志。
4、CSS 表格设置:
表格边框: border 属性。
下面的例子为 table、th 以及 td 设置了蓝色边框:
table, th, td{border: 1px solid blue;}
折叠边框:border-collapse 属性设置将表格边框折叠为单一边框:
table{border-collapse:collapse;}
表格宽度和高度:通过 width 和 height 属性定义表格的宽度和高度。
table{width:100%;}
th{height:50px;}
表格文本对齐:text-align 属性设置水平对齐方式,比如左对齐、右对齐或者居中:
td{text-align:right;}
vertical-align 属性设置垂直对齐方式,比如顶部对齐、底部对齐或居中对齐:
td{height:50px;vertical-align:bottom;}
表格内边距:控制表格中内容与边框的距离,请为 td 和 th 元素设置 padding 属性:
td{padding:15px;}
表格颜色:
下面的例子设置边框的颜色,以及 th 元素的文本和背景颜色:
table, td, th{border:1px solid green;}
th{background-color:green;color:white;}
5、css outline 轮廓线设置:
ooutline:在一个声明中设置所有的轮廓的属性。
outline-color:设置轮廓的颜色。
outline-style:设置轮廓的样式。包括以下选项:
none:默认。定义无轮廓。
dotted:定义点状的轮廓。
dashed:定义虚线轮廓。
solid:定义实线轮廓。
double:定义双线轮廓。双线的宽度等于 outline-width 的值。
groove:定义 3D 凹槽轮廓。此效果取决于 outline-color 的值。
ridge:定义 3D 凹槽轮廓。此效果取决于 outline-color 的值。
inset:定义 3D 凹槽轮廓。此效果取决于 outline-color 的值。
outset:定义 3D 凹槽轮廓。此效果取决于 outline-color 的值。
inherit:规定应该从父元素继承轮廓样式的设置。
outline-width:设置轮廓的宽度。
thin:规定细轮廓。
medium:默认。规定中等的轮廓。
thick:规定粗轮廓。
length:数值。规定轮廓粗细的值。
inherit:规定应该从父元素继承轮廓样式的设置。
Gatsby (gatsby-source-strapi) - 您的数据问题中存在冲突的字段类型
如何解决Gatsby (gatsby-source-strapi) - 您的数据问题中存在冲突的字段类型?
我使用 Gatsby 和 Strapi 已经有一段时间了。
我们一直在使用 gatsby-source-graphql 直到几天前,由于 gatsby-source-graphql 无法与 Gatsby Live Preview 配合使用,公司决定改用 gatsby-source-strapi无论如何...
我们开始重构查询,一切似乎都运行良好,直到出现这个问题:
当然 - 所有这些字段都从数据中消失了,所以我无法访问它。
我试图做的是按照警告描述中的说明定义类型。
所以我在 gatsby-node.js 中所做的是这样的:
exports.createSchemaCustomization = ({ actions }) => {
const { createTypes } = actions
const typeDefs = `
type StrapiLandingPages implements Node {
programmes: [StrapiLandingPagesProgrammes]
}
type StrapiLandingPagesProgrammes {
certification: StrapiLandingPagesProgrammesCertification
}
type StrapiLandingPagesProgrammesCertification implements Node @dontInfer {
id: Int!
Title: String
slugUid: String
sectionTitle: String
content: String
published_at: Date @dateformat
created_at: Date @dateformat
updated_at: Date @dateformat
}
`
createTypes(typeDefs)
}
但它似乎没有按预期工作。我设法看到了“认证”字段,但其中的所有数据都为空。
知道如何解决这个问题吗?
谢谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
今天关于gatsby build 不包含来自 css 库的 svg 图标和不包含actionscript的分享就到这里,希望大家有所收获,若想了解更多关于'gatsby-source-graphql' 导致加载插件错误引用 'gatsby/graphql' 我将它包含在我的 gatsby-config.js 中,如下所示:但它产生了这个错误:我尝试过的:我使用 gatsby info --clipboard 的环境报告是:有什么想法吗?导致问题的原因如下:、等相关知识,可以在本站进行查询。
本文标签: