typescript - 类型 'null' 的参数不可分配给类型 'TableContinuationToken' 的参数

标签 typescript azure eslint azure-table-storage azure-tablequery

根据文档link ,当使用 queryEntities 查询表时,continuationToken 可以作为 nullundefined 传入(请使用 '如果这是第一个操作,则为 null”或“未定义”。) 但是,这不会编译:“null”类型的参数不可分配给“TableContinuationToken”类型的参数。

运行服务器时出现错误。 enter image description here

并且这个错误也被 eslint 捕获。 enter image description here

最佳答案

我有 3 个解决方案来解决这个问题。

  1. 使用@ts-ignore enter image description here

  2. null前面使用enter image description here

  3. 使用null 作为any。 Sonar Linting 也推荐了这个 enter image description here

两种解决方案都有效,我能够启动服务器。 enter image description here

关于typescript - 类型 'null' 的参数不可分配给类型 'TableContinuationToken' 的参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67720994/

相关文章:

azure - 如何从 Azure DevOps 在 Microsoft Excel 中打开工作项查询结果?

javascript - Visual Studio Code 中的嵌套 .eslintrc 文件

entity-framework - session Azure 缓存中的 EF 动态代理

javascript - ESLint 配置问题

visual-studio-code - ESLint 不工作 : VSCode warning: "ESLint is disabled since its execution has not been approved or denied yet"

typescript - 如何使用 Material UI 和 TypeScript 将自定义 Prop 传递给样式化组件?

javascript - 如何使用 typescript 向对象添加属性?

javascript - 为什么使用 setTimeout 可以显示图表

javascript - Angular 2+ 加载整个模块还是只加载导出的组件?

azure - 寻找向 Service Fabric 开发集群添加新节点的方法