小编Nts*_*ane的帖子

如何解决未处理的承诺拒绝:错误:无法激活保持清醒React Native

你好,我是 React Native 的新手,所以我正忙于了解它的要点,所以在添加这段代码后,我开始收到以下错误。

[Unhandled promise rejection: Error: Unable to activate keep awake]
- node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:103:50 in   promiseMethodWrapper
- node_modules/@unimodules/react-native-adapter/build /NativeModulesProxy.native.js:15:23 in moduleName.methodInfo.name
- node_modules/expo-keep-awake/build/index.js:10:58 in activateKeepAwake
- node_modules/expo/build/launch/registerRootComponent.expo.js:6:4 in <global>
- node_modules/metro/src/lib/polyfills/require.js:321:11 in loadModuleImplementation
- node_modules/expo/AppEntry.js:1:0 in <global>
- node_modules/metro/src/lib/polyfills/require.js:321:11 in loadModuleImplementation
- node_modules/metro/src/lib/polyfills/require.js:201:44 in guardedLoadModule
* http://192.168.1.96:19001/node_modules/expo/AppEntry.bundle?platform=android& dev=true&minify=false&hot=false:154700:3 in global code
Run Code Online (Sandbox Code Playgroud)

下面是我添加的可能导致该错误的代码

import { FloatingAction } from "react-native-floating-action";
const FloatingHomeButton = () => {
  const actions = [
    {
      text: "Accessibility",
      icon: require("../images/tweet.png"),
      name: "bt_accessibility",
      position: 2,
    },
  ]; …
Run Code Online (Sandbox Code Playgroud)

react-native

7
推荐指数
1
解决办法
9829
查看次数

内容更改后,Puppeteer 无法第二次单击具有相同 id 的标签

在 Puppeteer 上工作来学习,所以我正在尝试填写这个网站

脚本的作用是什么

  • 转到上面的链接
  • 点击“创建临时 ID”
  • 填写表格
  • 单击继续
  • 内容变更
  • 再次单击继续(这是与第一个“继续”按钮具有相同 ID 值的同一个按钮

问题

  • 当我第二次单击“继续”按钮时,该按钮与第一次工作的 ID 相同,但它失败了

脚本

import tesseract from 'node-tesseract-ocr';
import Puppeteer from 'puppeteer';

const config = {
  lang: 'eng', // default
  oem: 3,
  psm: 13,
};

export class AutomationController {
  public async CreateProfile(data: any) {
    try {
      const _data = {
        nationality: 'BRA',
        id: '0508228690083',
        title: 'Mr',
        firstName: 'Shaun',
        middleName: 'Maxwell',
        surname: 'Smith',
        dob: '15062001',
        gender: 'M',
        email: 'shaun@gmail.com',
        countryCode: '+27',
        mobileNumber: '0832567890',
      };

      const browser …
Run Code Online (Sandbox Code Playgroud)

javascript web-scraping typescript puppeteer

7
推荐指数
1
解决办法
123
查看次数

NodeJS TypeScript - Mongoose index.d.ts 抛出错误

你好,所以我不知道这里有什么问题,所以当我运行我的 NodeJS 服务器时,猫鼬index.d.ts抛出了多个我不知道的错误,我尝试忽略tsconfig 中的 node_modules 但似乎我没有获胜

收到错误:我给了 pastebin 链接,因为回溯很长,我不想减少潜在的错误: pastebin 链接包含所有错误消息

错误标题

node_modules/@types/mongoose/index.d.ts:79:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: DocumentDefinition, FilterQuery, UpdateQuery, NativeError, Mongoose, SchemaTypes, STATES, connection, connections, models, mongo, version, CastError, ConnectionOptions, Collection, Connection, disconnected, connected, connecting, disconnecting, uninitialized, Error, QueryCursor, VirtualType, Schema, SchemaTypeOpts, Subdocument, Array, DocumentArray, Buffer, ObjectId, ObjectIdConstructor, Decimal128, Map, mquery, Aggregate, SchemaType, Promise, PromiseProvider, Model, Document, ModelUpdateOptions
Run Code Online (Sandbox Code Playgroud)

我的tsonfig

{
  "compilerOptions": {
    "module": "commonjs",
    "esModuleInterop": …
Run Code Online (Sandbox Code Playgroud)

mongoose node.js typescript

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