我试图在应用程序中进行一些修改后,最初从https://github.com/subhendukundu/template-react-ssr/tree/feature/react-router分发的firebase中部署我的SSR应用程序.我做的时候工作得很好,sudo firebase serve --only functions,hosting但是当我做的时候会抛出错误firebase deploy.可重复的回购是https://github.com/subhendukundu/template-react-ssr/tree/feature/react-router,它有一个package.json https://github.com/subhendukundu/template-react-ssr/ tree/feature/react-router/public
我也使用公共目录作为我的函数目录,https://github.com/subhendukundu/template-react-ssr/blob/feature/react-router/firebase.json.但是,即使我为我的云功能使用不同的功能目录,我也会看到相同的错误.无论如何我能解决它吗?
firebase reactjs firebase-hosting google-cloud-functions next.js
在我package.json看来,"main": "./dist/"我理解这种对index.js. 但是在 dist 文件夹中,我有名为string.js, 的单个文件class.js,dom.js我打算将它们导入为,
import { isValidZipCode } from '@scope/utils/string';但现在我必须将它们导入为import { isValidZipCode } from '@scope/utils/dist/string';
当我从中导入模块时,有没有办法解析文件夹node_modules?
编辑:主要思想是导入文件,就像import { isValidZipCode } from '@scope/utils/string'我为单个导出保留单个文件一样。
我面临与Github 问题相同的问题,但适用于不同的用例。我正在尝试添加应用程序的多个实例:此处的示例代码。
添加域后,我收到相同的错误:
Domain www.app.com was not found in your AWS account.
Run Code Online (Sandbox Code Playgroud)
因此,为了实现多个实例,我尝试将 env-prod 文件更改为bucket="prod-appname". 这已部署,但是当我将 env-stage 文件添加到 时bucket="stage-appname",这会创建一个新存储桶,但会将其部署到相同的 CloudFront URL。有没有办法修复它们中的任何一个,以便我可以实现多个实例?
提前致谢
javascript amazon-web-services amazon-cloudfront serverless-framework next.js
我已经玩了几天 flutter,还没有掌握它的窍门。在尝试 dart 及其方法时,我开始思考如何让学习曲线更容易开始与 javascript 相关(因为我非常熟悉它,个人选择,人们可能有或使用不同的方法)。
我有一个小疑问,在 dart 中是否可以同时解构和传播?我知道如果不可能,我如何用 dart 实现这样的目标?我试图获取变量中数组的第一项和字符串中的其余数组值,并将它们作为字符串连接起来。我必须遍历所有这些吗?不能以更短或更漂亮的方式(透视)?
// JavaScript
var someArray = ['1', '2' ,'3', '4'];
var [first, ...rest] = someArray;
var restAsString = rest.join(' ');
console.log(first); // 1
console.log(restAsString); // 2 3 4
Run Code Online (Sandbox Code Playgroud)
//dart
main(List<String> arguments) {
List<String> someList = ['1', '2' ,'3', '4'];
String restString = '';
String firstString = '';
for (int i = 0; i < someList.length; i++) {
if(i == 0 ) {
firstString = someList[i];
} else {
restString = …Run Code Online (Sandbox Code Playgroud) 我正在尝试检索用户输入的邮政编码,该邮政编码已添加到webview的cookie中。我如何得到它?我试过react-native-cookies哪个是空对象。
import CookieManager from 'react-native-cookies';
componentWillMount() {
CookieManager.get('https://www.example.com')
.then((res) => {
console.log('CookieManager.get from webkit-view =>', res);
});
}
}
<WebView
style={styles.webview}
source={{ uri: 'https://www.example.com' }}
injectedJavaScript={INJECTED_JAVASCRIPT}
mixedContentMode="compatibility"
javaScriptEnabled
domStorageEnabled
thirdPartyCookiesEnabled
sharedCookiesEnabled
originWhitelist={['*']}
useWebKit
/>
Run Code Online (Sandbox Code Playgroud)
我正在iOS模拟器中尝试。Android很棒。我看到https://github.com/react-native-community/react-native-webview/pull/175已合并,但无法弄清楚如何使用它来获取用户设置的cookie。
react-native react-native-ios react-native-webview react-native-cookies
我正在为我的 APP 使用 AppSync。这是我的 Schema.graphql 文件的快速浏览
type Item @model
@auth(rules: [
{ allow: public, provider: apiKey, operations: [read] },
{ allow: groups, groups: ["admin"] }
]) {
id: ID!
name: String!
soldUnits: String!
soldAs: [Float!]
price: Float!
isAvailable: Boolean!
availableAmount: Float!
category: String!
isVeg: Boolean!
offer: [String!]
about: String
storage: String
benifits: String
otherInfo: String
rating: Int
keywords: [String!]
reviews: [String]
images: [String]
updatedBy: String
addedBy: String
qty: Int
inventroy: Inventory @connection(name: "ItemInventory")
}
type User @model {
id: ID! …Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一个要在 Excel 工作表中更新的应用程序。我遇到了https://github.com/dwyl/html-form-send-email-via-google-script-without-server,它显然不适用于 angular。将 ajax 调用替换为
onsubmitForm() {
let headers = new Headers();
headers.append('Access-Control-Allow-Origin','*');
let options = new RequestOptions({ headers: headers });
let body = {
name:"lala",
message:"ssss",
email:"a@k.com",
color:"red"
}
return this.http.put('https://script.google.com/macros/s/AKfycbxJKxvzl8Go5ZihUc95su-HFvFeoTtnMyA3qq5YiBxcDYalDdOb/exec', body).toPromise(); }
Run Code Online (Sandbox Code Playgroud)
我收到一条错误消息,“对预检请求的响应未通过访问控制检查:没有‘Access-Control-Allow-Origin’”。有办法解决吗?或者可能是使用 angular 2 将数据添加到 Excel 工作表的另一种方法?
我正在尝试使用 Google 表格 API V4 从 Google 表格中获取数据。是否有可能知道是否有人保存了数据或在工作表上进行了更改?基于此,我想调用 api 以获取数据?更像是我试图让我的应用程序与谷歌表同步。只要有人更新数据,我的应用程序也会更新。我正在使用 Node.js。我怎么做?提前致谢
google-sheets node.js sendasynchronousrequest google-sheets-api
我想在一侧添加虚线边框,
{
height: '100%',
width: 20,
position: 'absolute',
borderRadius : 1,
borderStyle: 'dashed',
borderRightWidth: 1,
borderRightColor: 'rgba(161,155,183,1)'
}
Run Code Online (Sandbox Code Playgroud)
这不起作用,但是当我将其更改为
{
height: '100%',
width: 20,
position: 'absolute',
borderRadius : 1,
borderStyle: 'dashed',
borderWidth: 1,
borderColor: 'rgba(161,155,183,1)'
}
Run Code Online (Sandbox Code Playgroud)
可以工作,但边界在 4 边。如何仅在一侧添加边框?还有没有办法增加破折号的间距?
"react-native": "0.57.7"
我已经更新了问题,找到了问题的根本原因。当我托管了我的React SSR应用程序时,该应用程序在客户端中使用Firebase数据库,该客户端通过名为的云函数之一app抛出错误Error: FIREBASE FATAL ERROR: Database initialized multiple times. Please make sure the format of the database URL matches with each database() call.。当我逐一注释并部署时,效果很好。但是当我一起部署时不起作用。如何将这两个保持在相同的仓库中分开?
原始问题:Why firebase cloud function throwing an error of 'The default Firebase app does not exist.'?
所以我第一次尝试使用firebase函数。admin.messaging()向我抛出以下错误。帮我弄清楚为什么吗?如果我看一下控制台,我会得到结果,直到console.log('deviceToken', deviceToken);
那么const messageDone = await admin.messaging().sendToDevice(deviceToken, payload);怎么了?
const functions = require('firebase-functions');
const admin = require('firebase-admin');
exports.updateUnreadCount = functions.database.ref('/chats/{chatId}/{messageId}')
.onCreate(async(snap, context) => {
const appOptions = JSON.parse(process.env.FIREBASE_CONFIG);
appOptions.databaseAuthVariableOverride = context.auth;
const adminApp = admin.initializeApp(appOptions, …Run Code Online (Sandbox Code Playgroud) javascript ×4
node.js ×3
reactjs ×3
firebase ×2
next.js ×2
react-native ×2
android ×1
angular ×1
angular-cli ×1
aws-amplify ×1
aws-appsync ×1
dart ×1
flutter ×1
graphql ×1
ios ×1
node-modules ×1
npm ×1
yarnpkg ×1