GVKun编程网logo

TypeError:this.getOptions 不是函数(typeerror: this.getoptions is not a function)

8

在本文中,您将会了解到关于TypeError:this.getOptions不是函数的新资讯,同时我们还将为您解释typeerror:this.getoptionsisnotafunction的相关在

在本文中,您将会了解到关于TypeError:this.getOptions 不是函数的新资讯,同时我们还将为您解释typeerror: this.getoptions is not a function的相关在本文中,我们将带你探索TypeError:this.getOptions 不是函数的奥秘,分析typeerror: this.getoptions is not a function的特点,并给出一些关于Adonisjs 5.0 TypeError:this.container.singleton 不是函数、angular 2:TypeError:this.form.updateValueAndValidity不是函数、angular – RXJS:TypeError:this._subscribe不是函数、Discord.js - TypeError:client.on 不是函数的实用技巧。

本文目录一览:

TypeError:this.getOptions 不是函数(typeerror: this.getoptions is not a function)

TypeError:this.getOptions 不是函数(typeerror: this.getoptions is not a function)

安装Bootstrap时遇到一个奇怪的错误。错误如下。我尝试卸载less-loader并安装less-
loader@5.0.0,因为我在网上看到它,但它什么也没做。我不确定在这一步该怎么做。

语法错误:TypeError:this.getOptions 不是函数

 @ ./node_modules/vue-style-loader??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/vue-loader-v16/dist/stylePostLoader.js!./node_modules/postcss-loader/src??ref--8-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/App.vue?vue&type=style&index=0&id=7ba5bd90&lang=scss 4:14-419 14:3-18:5 15:22-427 @ ./src/App.vue?vue&type=style&index=0&id=7ba5bd90&lang=scss @ ./src/App.vue @ ./src/main.js @ multi (webpack)-dev-server/client?http://192.168.1.182:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

答案1

小编典典

与@KostDM 所说的类似,就我而言,它似乎sass-loader@11.0.0不适用于vue@2.6.12.

我安装了sass-loader@10.1.1它,它再次像魅力一样工作。

在你的package.json

"sass-loader": "^10",

Adonisjs 5.0 TypeError:this.container.singleton 不是函数

Adonisjs 5.0 TypeError:this.container.singleton 不是函数

如何解决Adonisjs 5.0 TypeError:this.container.singleton 不是函数?

我刚刚在 adonisjs5 上安装了 adonis5-scheduler,但每次尝试提供服务时都会出错

操作系统:Windows 10 节点版本:14.6.1 npx 版本:6.14.12

预期结果 --构建服务

实际结果

TypeError: this.container.singleton is not a function


1 SchedulerProvider.register
  C:\Users\user\Documents\Code\Sacro\node_modules\adonis5-scheduler\build\providers\SchedulerProvider.js:16

2 anonymous
  C:\Users\user\Documents\Code\Sacro\node_modules\@adonisjs\fold\build\src\Registrar\index.js:103

3 Registrar.register
  C:\Users\user\Documents\Code\Sacro\node_modules\@adonisjs\fold\build\src\Registrar\index.js:101

4 anonymous
  C:\Users\user\Documents\Code\Sacro\node_modules\@adonisjs\application\build\src\Application.js:530

5 Application.registerProviders
  C:\Users\user\Documents\Code\Sacro\node_modules\@adonisjs\application\build\src\Application.js:524

6 HttpServer.wire
  C:\Users\user\Documents\Code\Sacro\node_modules\@adonisjs\core\build\src\Ignitor\HttpServer\index.js:52

7 HttpServer.start
  C:\Users\user\Documents\Code\Sacro\node_modules\@adonisjs\core\build\src\Ignitor\HttpServer\index.js:146

这是我在评论部分要求的 package.json 文件中的代码。

{
  "name": "Sacro","version": "1.0.0","private": true,"scripts": {
    "build": "node ace build --production","start": "node server.js","dev": "node ace serve --watch","lint": "eslint . --ext=.ts"
  },"devDependencies": {
    "@adonisjs/assembler": "^5.2.0","@types/jsdom": "^16.2.10","@types/supertest": "^2.0.11","adonis-preset-ts": "^2.1.0","eslint": "^7.26.0","eslint-plugin-adonis": "^1.3.1","get-port": "^5.1.1","japa": "^3.1.1","jsdom": "^16.5.3","pino-pretty": "^4.8.0","supertest": "^6.1.3","typescript": "^4.2.4","youch": "^2.2.2","youch-terminal": "^1.1.1"
  },"dependencies": {
    "@adonisjs/auth": "^5.1.1","@adonisjs/core": "^5.1.6","@adonisjs/lucid": "^10.0.0","@adonisjs/repl": "^3.1.2","adonis5-scheduler": "^1.0.1","adonisjs-paystack": "^0.2.0","axios": "^0.21.1","luxon": "^1.27.0","MysqL": "^2.18.1","phc-argon2": "^1.1.1","proxy-addr": "^2.0.6","reflect-Metadata": "^0.1.13","source-map-support": "^0.5.19"
  }
}

解决方法

node_modules/adonis5-scheduler/build/providers/SchedulerProvider 中,您可以进行修补程序:

添加一个?仅当容器不为空/未定义时才在容器调用后继续评估

[...]this.app.container?.singleton[...] 在第 16 行

[...]this.app.container?.bind[...] 在第 21 行

重要提示: 我打开了一个 issue 报告这个,但我记得我在它的 alpha 版本中使用了 Adonis 5.. 在创建了一个全新的最新版本 Adonis 5 项目 (npm init adonis-ts-app@latest project-name-here) 并安装了 { {1}},成功了

angular 2:TypeError:this.form.updateValueAndValidity不是函数

angular 2:TypeError:this.form.updateValueAndValidity不是函数

在这一点上没有源代码,请随意关注这个问题,我对于角度2开发中的这种痛苦(但必要的)连续弃用模式感到有点厌倦.

所以我升级到rc.4并尝试使用新的forms-api.这就是我得到的:

“TypeError:this.form.updateValueAndValidity不是函数”

上述错误消息对任何人都有意义吗?

谢谢

编辑:
好的,源代码毕竟:
异常来自angular中的文件“form_group_directive.js”:

FormGroupDirective.prototype.ngOnChanges = function (changes) {
    this._checkFormPresent();
    if (collection_1.StringMapWrapper.contains(changes,'form')) {
        var sync = shared_1.composeValidators(this._validators);
        this.form.validator = validators_1.Validators.compose([this.form.validator,sync]);
        var async = shared_1.composeAsyncValidators(this._asyncValidators);
        console.log('from within angular:---------------------------------------------------------------------------------------------------');
        console.log(this.form);
        this.form.asyncValidator = validators_1.Validators.composeAsync([this.form.asyncValidator,async]);
        this.form.updateValueAndValidity({ onlySelf: true,emitEvent: false });
    }

console.log-statement的输出是一个“FormGroupDirective”,它没有一个名为“updateValueAndValidity”的方法

解决方法

我不认为你可以同时使用模板驱动的方法和模型驱动的方法.

所以我会使用以下两种方法:

<form  *ngIf="showForm" #userForm="ngForm"
   (ngSubmit)="userFormSubmit()">
</form>

要么:

<form  *ngIf="showForm" [formGroup]="userForm"
   (ngSubmit)="userFormSubmit()">
</form>

其中userForm是使用FormBuilder或FormControl在组件类中定义的.我认为这种方法是你需要的……

angular – RXJS:TypeError:this._subscribe不是函数

angular – RXJS:TypeError:this._subscribe不是函数

我正在将离子3.8应用程序迁移到3.9.2.
此迁移包括对RXJS 5.5的更新

我现在遇到这个错误:

TypeError:this._subscribe不是函数. (在’this._subscribe(sink)’中,’this._subscribe’是t的一个实例)

经过几个小时的调试,我发现这个代码部分与错误有关:

protected observeConnectionState() {

    // rxjs/observable/of
    of(new Event('disconnect'))
        .pipe(
            // rxjs/operators/merge
            merge(connect$),merge(disconnect$),// Map eventname to string (rxjs/operators/map)
            map((e: IEvent) => {
                return e.eventName == 'connect' ? 'connected' : 'disconnected';
            })
        )
        // Apply to class context
        .subscribe((newConnectionState) => {
            // this.connectionState$is a BehaviorSubject
            this.connectionState$.next(newConnectionState);
        });
}

附加信息

> RXJS代码中有两个地方,我能找到这个._subscribe:Observable.ts Line 203和Observable.ts Line 208.

好吧,我发现了问题.它与科尔多瓦无关.

对于遇到此问题的其他人:
忘记堆栈跟踪 – 它没用.在我的情况下,在this.connectionState $的订阅者中,我尝试从promise创建一个Observable.但我做错了.

这是错的:

import { Observable } from 'rxjs/Observable';
//...
const myObservable$= Observable.create(myPromise);

这是应该如何做到的:

import { fromPromise } from 'rxjs/observable/fromPromise';
// ...
const myObservable$= fromPromise(myPromise);

Discord.js - TypeError:client.on 不是函数

Discord.js - TypeError:client.on 不是函数

您没有正确创建 client。您需要在 event code 的最顶部添加:

const Discord = require('discord.js');
const client = new Discord.Client();
,

您没有正确声明“客户端”,请确保添加此 -

const { Client }= require('discord');
const client = new Client()

今天的关于TypeError:this.getOptions 不是函数typeerror: this.getoptions is not a function的分享已经结束,谢谢您的关注,如果想了解更多关于Adonisjs 5.0 TypeError:this.container.singleton 不是函数、angular 2:TypeError:this.form.updateValueAndValidity不是函数、angular – RXJS:TypeError:this._subscribe不是函数、Discord.js - TypeError:client.on 不是函数的相关知识,请在本站进行查询。

本文标签: