GVKun编程网logo

Firebase Cloud Function 的 Angular 10 Universal Build 中缺少 package.json(缺少base或compare)

16

在这篇文章中,我们将带领您了解FirebaseCloudFunction的Angular10UniversalBuild中缺少package.json的全貌,包括缺少base或compare的相关情况

在这篇文章中,我们将带领您了解Firebase Cloud Function 的 Angular 10 Universal Build 中缺少 package.json的全貌,包括缺少base或compare的相关情况。同时,我们还将为您介绍有关A full rebuild may help if ''OptionParser.class'' was compiled against an incompatible version of scala.、android – Google Cloud Function Node.js Firebase网址、Angular 2 – IE11属性“webpackJsonp”的值为null或undefined,而不是Function对象、angular – Firebase Ionic3错误:disallowed_useragent的知识,以帮助您更好地理解这个主题。

本文目录一览:

Firebase Cloud Function 的 Angular 10 Universal Build 中缺少 package.json(缺少base或compare)

Firebase Cloud Function 的 Angular 10 Universal Build 中缺少 package.json(缺少base或compare)

如何解决Firebase Cloud Function 的 Angular 10 Universal Build 中缺少 package.json?

我正在尝试将 Angular 10 通用应用程序部署到 Firebase 云函数。但是,部署失败,因为 firebase CLI 工具在“dist”目录中找不到“package.json”文件。运行 npm run build:ssr 不会生成文件,但它会生成一个包含“浏览器”和“服务器”目录的工作构建,我可以使用 npm run serve:ssr 提供这些目录。

将 Angular Universal 部署到 Firebase 的在线指南似乎都过时了。例如,他们提到使用 Webpack,我认为不再需要。

我从一个干净的项目开始。我添加的只是 ng add @nguniversal/express-engineng add @angular/fire。然后在 functions 目录中,我复制了我的构建并创建了一个 Firebase 函数。

import * as functions from ''firebase-functions'';
const universal = require(`${process.cwd()}/dist/ssr-test/server/main.js`).app;

export const ssr = functions.https.onRequest(universal);

也许自动生成的 angular.jsonfirebase.json 文件有问题?

更新(2021 年 2 月 3 日)

我发现了问题。我将很快在此处发布,并为将来遇到此问题的任何人提供分步说明。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

A full rebuild may help if ''OptionParser.class'' was compiled against an incompatible version of scala.

A full rebuild may help if ''OptionParser.class'' was compiled against an incompatible version of scala.

src\main\scala info: compiling
[ERROR] error: missing or invalid dependency detected while loading class file ''OptionParser.class''.
[INFO] Could not access type ScalaObject in package scala,
[INFO] because it (or its dependencies) are missing. Check your build definition for
[INFO] missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
[INFO] A full rebuild may help if ''OptionParser.class'' was compiled against an incompatible version of scala.
[ERROR] error: missing or invalid dependency detected while loading class file ''Read.class''.
[INFO] Could not access type ScalaObject in package scala,
[INFO] because it (or its dependencies) are missing. Check your build definition for
[INFO] missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
[INFO] A full rebuild may help if ''Read.class'' was compiled against an incompatible version of scala.
[ERROR] error: missing or invalid dependency detected while loading class file ''OptionDef.class''.
[INFO] Could not access type ScalaObject in package scala,
[INFO] because it (or its dependencies) are missing. Check your build definition for
[INFO] missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
[INFO] A full rebuild may help if ''OptionDef.class'' was compiled against an incompatible version of scala.
[ERROR] three errors found
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ----------------------------------------------------------

android – Google Cloud Function Node.js Firebase网址

android – Google Cloud Function Node.js Firebase网址

我有一个 Android应用程序,我能够以http格式从我的设备发送推送通知,但现在我想写一个节点,我希望在特定的日期和时间安排推送通知,有人请帮助我,我是长期坚持这个过程

这是我的节点;

const functions = require(''firebase-functions'');
const admin = require(''firebase-admin'');
admin.initializeApp(functions.config().firebase);


exports.sendNotification = functions.https.onRequest((req,res) => {
  const to = req.query.to;
  const title = req.query.title;
  const body = req.query.body;

  var payload;
  if (body != undefined && body !== '''') {
    payload = {
      notification: {
        title: title,body: body
      }
    };
  } else {
    payload = {
      notification: {
        title: title
      }
    };
  }

  var options = {
    priority: "high",timetoLive: 60 * 60 * 24
  };

  if (to == ''all'') {
    admin.messaging().sendToTopic(to,payload,options)
      .then(function (response) {
        res.send(200,''ok'');
      })
      .catch(function (error) {
        res.send(200,''Failed'');
      });
  } else {
    admin.messaging().sendToDevice(to,''Failed'');
      });
  }
});

在运行推送通知时,我有URL,

https://MyProjectName.cloudfunctions.net/sendNotification?to=all&title=hello&body=EnterBodyHere

现在,请帮我安排这样的推送通知

本地主机:8080:/?schedulePush天= 17&安培;一个月= 10安培;小时= 12&安培;分钟= 22

解决方法

云功能目前没有内置的调度机制.如果要在特定时间执行函数,则需要使用其他调度程序.有一个关于这个的 blog post,以及 sample code也讨论了这一点.

Angular 2 – IE11属性“webpackJsonp”的值为null或undefined,而不是Function对象

Angular 2 – IE11属性“webpackJsonp”的值为null或undefined,而不是Function对象

我是Angular 2的新手.我安装了Angular-CLI(遵循 https://github.com/angular/angular-cli)并创建了一个示例项目.

现在,我使用“ng build –prod”构建了应用程序,并在IIS中托管了“dist”文件夹.
当我在IE11中使用“localhost / index.html”浏览网站时,一切正常.
我使用服务器地址“ServerName / index.html”浏览到同一站点的那一刻我得到:

IE11属性“webpackJsonp”的值为null或未定义,而不是Function对象

但是,在GoogleChrome和Firefox中做同样的工作就好了!

非常感谢您的帮助/提示!

解决方法

我想到了.我在兼容模式下使用了IE11.我删除了它,现在一切正常. –

angular – Firebase Ionic3错误:disallowed_useragent

angular – Firebase Ionic3错误:disallowed_useragent

在 this topic上有几个其他问题/答案,但他们没有使用带有Ionic的Firebase.我刚刚切换到新的Ionic View,现在,我的应用程序在旧的Ionic View中工作,而新的Ionic View给出了这个众所周知的错误:

403 Error – Thats an error. Error: disallowed_useragent his user-agent
is not permitted to make an OAuth authorization request to Google as
it is classified as an embedded user-agent (also kNown as a web-view).
blah blah blah

在我的代码中,我注入Firebase AuthProvider并使用angularfire2进行连接,它看起来像

private getProvider(from: string): AuthProvider {
  switch (from) {
    case 'twitter': return new firebase.auth.TwitterauthProvider();
    case 'facebook': return new firebase.auth.FacebookAuthProvider();
    case 'github': return new firebase.auth.GithubAuthProvider();
    case 'google': return new firebase.auth.GoogleAuthProvider();
  }
}

  signIn(from: string) {
    this.afAuth.auth.signInWithPopup(this.getProvider(from))
. . .

再次,这在浏览器或旧的Ionic中很有用,但不适用于新的Ionic View.我确实有一个相当大的库与一般OAuth连接,但我认为使用Firebase的一个重要原因是我们不再需要使用这些库并自己管理用户.

有没有办法通过Ionic在iOS / Android应用上进行Firebase身份验证?

解决方法

试试这个

离子cordova构建android –minifycss –optimizejs –minifyjs

为我解决了

今天关于Firebase Cloud Function 的 Angular 10 Universal Build 中缺少 package.json缺少base或compare的分享就到这里,希望大家有所收获,若想了解更多关于A full rebuild may help if ''OptionParser.class'' was compiled against an incompatible version of scala.、android – Google Cloud Function Node.js Firebase网址、Angular 2 – IE11属性“webpackJsonp”的值为null或undefined,而不是Function对象、angular – Firebase Ionic3错误:disallowed_useragent等相关知识,可以在本站进行查询。

本文标签: