Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
724 views
in Technique[技术] by (71.8m points)

javascript - UNHANDLED REJECTION TypeError: Only absolute URLs are supported

I am getting only absolute urls allowed error it doesn't quote which file it comes from but I think its from my index.js the error is as follow. I am not sure from where it comes but the error comes when the following code attached below takes place in the message event

[UNHANDLED REJECTION] TypeError: Only absolute URLs are supported
at getNodeRequestOptions (/home/container/node_modules/node-fetch/lib/index.js:1305:9)
at /home/container/node_modules/node-fetch/lib/index.js:1410:19
at new Promise (<anonymous>)
at fetch (/home/container/node_modules/node-fetch/lib/index.js:1407:9)
at HTTPRequest.PlatformNode.fetch (/home/container/node_modules/@tensorflow/tfjs/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:6107:16)
at HTTPRequest.<anonymous> (/home/container/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:7051:55)
at step (/home/container/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:81:23)
at Object.next (/home/container/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:62:53)
at /home/container/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:55:71
at new Promise (<anonymous>)

Code is as follows where i think it originates from

const { Client, Intents } = require("discord.js");
const Events = require("./Src/Handlers/EventHandler");
const conf = require("./Settings/conf.json");
const Session = require("./Training/Session.js");
const use = require("@tensorflow-models/universal-sentence-encoder");
const tf = require("@tensorflow/tfjs-node");
const JW = require("./Training/JaroWinkler.js");
const Fs = require("fs");
const path = require('path')

client.on('message',async message => {
    if(message.channel.id !=760758857105408040){
        let msg = message.content.split()
        if(msg.length === 0){return}
         const tox = require('./toxication')
    tox(message)
    }
   
    if (message.channel.name === 'chatbot'&&message.author.id != client.user.id) {
        args = message.content.slice().trim().split(/ +/g);
    var model = Session.getModel();
    if (!model) {
        model = await tf.loadLayersModel("file:///home/container/TextAI/model.json");
        Session.addModel(model);
    }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
...