小编pie*_*lgb的帖子

错误:HTTP 错误:400,收到无效的 JSON 负载。未知名称“skipLog”:找不到字段

我第一次尝试设置 firebase 功能。我按照文档中的步骤操作,但是当我运行时firebase init functions遇到此错误:

错误:HTTP 错误:400,收到无效的 JSON 负载。未知名称“skipLog”:找不到字段。

以下是该文件的摘录firebase-debug.log

[debug] [2022-04-20T08:53:35.659Z] <<< [apiv2][body] POST https://serviceusage.googleapis.com/v1/projects/<my_project_name>/services/cloudfunctions.googleapis.com:enable {"error":{"code":400,"message":"Invalid JSON payload received. Unknown name \"skipLog\": Cannot find field.","status":"INVALID_ARGUMENT","details":[{"@type":"type.googleapis.com/google.rpc.BadRequest","fieldViolations":[{"description":"Invalid JSON payload received. Unknown name \"skipLog\": Cannot find field."}]}]}}
[error] 
[error] Error: HTTP Error: 400, Invalid JSON payload received. Unknown name "skipLog": Cannot find field.
[debug] [2022-04-20T08:53:35.670Z] Error Context: {
  "body": {
    "error": {
      "code": 400,
      "message": "Invalid JSON payload received. Unknown name \"skipLog\": Cannot find field.",
      "status": …
Run Code Online (Sandbox Code Playgroud)

firebase google-cloud-functions

11
推荐指数
2
解决办法
3078
查看次数

tiptap - 在当前节点的下方/末尾插入节点

我正在尝试使用reactjs 创建一个带有tiptap 的文本编辑器。我想在编辑器的每个“块”(paragraph块、blockquote块、codeblock块...)旁边创建一个按钮,允许用户在所选块之前添加一个新的空块。它看起来像这样(概念编辑器):

在当前演示下方添加块

所以我尝试执行此操作的方法是将光标的位置设置在当前节点的末尾:

src/components/blocks/Paragraph.js

const Paragraph = (props) => {
    // ...

    

    return {
        // ...
        <button onMouseDown={() => {
            // ...

            // props.getPos() gives the position at the beginning of the block
            // props.node.nodeSize gives the "length" of the node
            const endPos = props.getPos() + props.node.nodeSize;
            props.editor.commands.focus(endPos);

            // ...
        }}>
             Add block below
        </button>
    }
}
Run Code Online (Sandbox Code Playgroud)

所以在这一点上,它有效。node但是,当我尝试在这个位置插入新的时......

// It will insert a paragraph node containing text "New block …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs prose-mirror tiptap

10
推荐指数
1
解决办法
9278
查看次数