我在网络上使用 Firebase JS sdk 一年了,没有任何问题。从版本更新我的代码5.3.1以使用最新的6.5.0SDK 版本后,我收到以下错误:
TypeError: firebase.auth is not a function
Run Code Online (Sandbox Code Playgroud)
我知道这条消息的意思,但我真的不明白为什么我会得到它。我检查了 firebase 文档,功能和方法名称保持不变。
这是我的旧解决方案:
// HTML
<script src="https://www.gstatic.com/firebasejs/5.3.1/firebase-app.js"></script>
// JS
var config = {
apiKey: "...",
authDomain: "...",
databaseURL: "...",
projectId: "...",
storageBucket: "...",
messagingSenderId: "...",
};
firebase.initializeApp(config);
const email = txtEmail.value;
const pass = txtPassword.value;
const auth = firebase.auth();
firebase.auth().createUserWithEmailAndPassword(email, pass).catch(function(error) {
var errorCode = error.code;
var errorMessage = error.message;
if (errorCode == 'auth/weak-password') {
showAlert(errorMessage, 'Error!');
}
if (errorCode == 'auth/email-already-in-use') { …Run Code Online (Sandbox Code Playgroud) 我已将 Python 安装在c:\users\dan\appdata\roaming\python\python38\python.exe. pip install工作正常,我可以在 IDE 中运行 Python 程序。我的问题是当我尝试安装某些东西时pipx出现以下错误:
C:\Users\dan>pipx install eth-brownie
No Python at 'c:\users\dan\appdata\local\programs\python\python38\python.exe'
Fatal error from pip prevented installation. Full pip output in file:
C:\Users\dan\.local\pipx\logs\cmd_2021-11-22_01.21.33_pip_errors.log
Error installing eth-brownie.
Run Code Online (Sandbox Code Playgroud)
我知道在错误的目录中pipx查找python.exe,但我不知道为什么,因为 Python 安装到了不同的位置并且路径很好 ( PYTHONPATH = C:\Users\dan\AppData\Roaming\Python\Python38)。我的问题是如何使pipx搜索python.exe代替?\appdata\roaming\python\python38\appdata\local\programs\python\python38\
(cmd_2021-11-22_01.21.33_pip_errors.log错误消息指向的文件夹中不存在,因此我看不到该日志)
我在Xcode 6中创建了一个新项目并得到警告,我无法解决.我只是想设置一个自定义,UITableViewCell因为我在Xcode 5中做了1000次.
UITableViewController和一个UITableViewCellUILabel拖入TableViewCell.h现在我收到了以下警告 TableViewCell.h
自动属性合成不会合成属性'textLabel',因为它是'readwrite'但它将通过另一个属性合成'readonly'
这是我UILabel从Interface Builder拖出来的
@property (weak, nonatomic) IBOutlet UILabel *textLabel;
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个警告?我以前从未见过它,它在Xcode 5中完美运行.
我想在Jinja2 HTML页面的开头添加一行代码。我可以轻松地将其添加为其他任何元标记等,但是我只需要在一页中使用此代码,因此没有理由将其保留在网站标题中。
我尝试将其作为字符串传递给render_template,但是它没有出现在最终渲染器中。
@app.route('/page')
def page():
str = "<script src='https://site.xy/api.js'></script>"
return render_template('page.html', script_string = str)
Run Code Online (Sandbox Code Playgroud)
page.html:
{% extends "layout.html" %}
{{script_string}}
{% block content %}
Run Code Online (Sandbox Code Playgroud)
我也尝试在带有块的布局文件中执行此操作,但是它也失败了。
{% block js %}<script src='https://site.xy/api.js'></script>{% endblock %}
Run Code Online (Sandbox Code Playgroud)
如何在page.html不添加脚本标签的情况下将其添加到其他页面?
python ×2
firebase ×1
flask ×1
ios ×1
javascript ×1
jinja2 ×1
objective-c ×1
pipx ×1
uitableview ×1
xcode6 ×1