要在sveltekit中导入和使用svg文件,我参考这篇文章 https://riez.medium.com/svelte-kit-importing-svg-as-svelte-component-781903fef4ae 顺便说一句,当我最终输入代码时
<svelte:component this={Logo} />
Run Code Online (Sandbox Code Playgroud)
我收到如下错误
<svelte:component this={...}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules
Run Code Online (Sandbox Code Playgroud)
我希望有人帮助我解决这个问题。
我打算通过请求调用 aws lambda 函数中的第三方 api。但它显示超时错误。我将 lambda 函数时间设置为 30 秒,当我使用邮递员调用该 api 时,它会在 5 秒内发送响应(错误)。我认为请求或者axios无法将请求发送到外部api或者无法接收响应。谁能帮我?我的代码:
request.post({url:url2, json:true, body:body, headers: {
'ACCESS_TIMESTAMP': timestamp,
'Content-Type': 'application/json'
} }, (error, response, body) => {
console.log("------------------I am here----------------------")
callback(null, error)
})
Run Code Online (Sandbox Code Playgroud)
当我使用 axios 时,代码如下:
let jsonbody = JSON.stringify(body)
axios.post(url2, jsonbody, {headers: {
'ACCESS_TIMESTAMP': timestamp,
'Content-Type': 'application/json'
}})
.then(res => {
callback(null, res.data)
})
.catch(err => {
callback(null, err)
})
Run Code Online (Sandbox Code Playgroud)
我想得到 res 或 err 的结果,但他们不行动。
我在两个 github 帐户中为不同的项目创建了两个 ssh 密钥。一个是我的帐户,另一个是公司帐户 github。我使用不同的 ssh-key 从事项目。所以每次当我打开不同的项目时我都会输入这个命令。
eval $(ssh-agent -s)
ssh-add ~/.ssh/id_rsa_my_git
Run Code Online (Sandbox Code Playgroud)
eval $(ssh-agent -s)
ssh-add ~/.ssh/id_rsa_company_git
Run Code Online (Sandbox Code Playgroud)
我希望通过向项目或电脑添加配置文件或使用其他方式来避免每次都输入此内容。
我使用 azure blobclientservice 上传图像,如下所示
let fr = new FileReader();
let result = {};
fr.onload = async function () {
var data = fr.result;
await blockBlobClient
.uploadData(data, {
concurrency: 20,
blobHTTPHeaders: {
blobContentType: photo.type,
},
})
.then((res) => {
result = res;
console.log(res);
})
.catch((error) => {
console.log(error);
result.error = true;
});
};
fr.readAsArrayBuffer(photo);
Run Code Online (Sandbox Code Playgroud)
我成功地从响应中获取了 url。我希望使用这个url作为html中图像标签的src,而不是从存储中下载所有数据。但它不显示图像,我只能看到 alt 而不是图像。我认为当图像作为公共存储在 aws s3 存储桶中时,可以使用 url 来读取图像。我希望在天蓝色存储中具有相同的功能。是否可以?如果有人帮助我,我将不胜感激。