小编use*_*970的帖子

错误:无法解析setupPlatform的所有参数:(?,[对象对象],[对象对象])

我将Angular更新为版本8,但遇到一个小问题。当我用离子发球启动应用程序时

 Error: Can't resolve all parameters for setupPlatform: (?, [object 
 Object], [object Object]).
    at syntaxError (http://localhost:8100/build/vendor.js:177346:17)
    at CompileMetadataResolver._getDependenciesMetadata 
 (http://localhost:8100/build/vendor.js:196072:35)
    at CompileMetadataResolver._getFactoryMetadata 
 (http://localhost:8100/build/vendor.js:195972:51)
   at CompileMetadataResolver.getProviderMetadata 
 (http://localhost:8100/build/vendor.js:196204:43)
  at http://localhost:8100/build/vendor.js:196134:49
  at Array.forEach (<anonymous>)
  at CompileMetadataResolver._getProvidersMetadata 
 (http://localhost:8100/build/vendor.js:196094:19)
  at http://localhost:8100/build/vendor.js:195717:119
  at Array.forEach (<anonymous>)
  at CompileMetadataResolver.getNgModuleMetadata 
(http://localhost:8100/build/vendor.js:195708:49)
Run Code Online (Sandbox Code Playgroud)

我试图回滚到旧版本,仍然遇到相同的问题。我有另一个离子应用程序,它可以与我的配置一起使用。

配置为:

Ionic:

  Ionic CLI          : 5.2.1
  Ionic Framework    : ionic-angular 3.9.6
  @ionic/app-scripts : 3.2.4

Cordova:

   Cordova CLI       : 6.5.0
   Cordova Platforms : android 6.1.2, browser 4.1.0, ios 4.5.5
   Cordova Plugins   : cordova-plugin-ionic-webview 1.2.1, (and 16 other plugins)

Utility: …
Run Code Online (Sandbox Code Playgroud)

typescript ionic-framework ionic-native angular

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

在类库中注册休息路线不起作用

我在构建WP插件时遇到了两个问题,问题是我想使用WP Rest API并通过自己的端点对其进行扩展。

我正在使用类对象编写代码,我注册了add_action('rest_api_init'我遇到的问题是端点现在正在路由中显示。

这是初始化插件时的代码。

class ThorAdmin {

    public function __construct() {

        // Activation and deactivation hook.
        register_activation_hook(WP_PLUGIN_DIR . '/wp-thor-fcm/wp-thor-fcm.php',  array($this, 'thor_fcm_activate'));
        register_deactivation_hook( WP_PLUGIN_DIR . '/wp-thor-fcm/wp-thor-fcm.php',  array($this, 'thor_fcm_deactivate' ));

        // Admin Menu
        add_action('admin_menu', array($this, 'thor_admin_menu'));
        add_action('admin_init', array($this, 'thor_fcm_settings_init'));

        add_action('wpmu_new_blog',  array($this, 'thor_on_new_blog', 10, 6));      
        add_action('activate_blog',  array($this, 'thor_on_new_blog', 10, 6));

        add_action('admin_enqueue_scripts', array($this, 'thor_head') );            

        //The Following registers an api route with multiple parameters. 
        add_action('rest_api_init', array($this, 'add_thor_fcm_route'));

        add_filter('admin_footer_text', array($this, 'thor_fcm_admin_footer'));
    }
Run Code Online (Sandbox Code Playgroud)

这是我从add_action('rest_api_init',array($ this,'add_thor_fcm_route'))调用的函数;

/**
 * Registers the routes for all and single options …
Run Code Online (Sandbox Code Playgroud)

wordpress wp-api

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

Firebase Cloud Function with Google Secrets Manager 如何让 async/await 工作

我有一个小问题,在我通过调用 Google Secret Manager API 获取 API 密钥之前,我的 firebase 云功能已完成。API 密钥很重要,因为它进行 API 调用以从外部服务器获取数据以将 API 调用的结果存储在 Google Cloud Storage 中。

这是我的代码,

'use strict';

// Request Data From A URL
var request = require('request');
var https = require('https');

// Var Firebase Functions
var functions = require('firebase-functions');
const admin = require('firebase-admin');

// Initalise App
admin.initializeApp();
// init firebase admin and get the default project id
const projectId = admin.instanceId().app.options.projectId

const util = require('util');
// Imports the Google Storage client library
const {Storage} = …
Run Code Online (Sandbox Code Playgroud)

javascript async-await google-cloud-platform google-cloud-functions

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