简体   繁体   English

使用Google登录构建聚合物项目时出错

[英]Error building polymer project with google-signin

Frankly, I'm not sure how to reproduce this error. 坦白说,我不确定如何重现此错误。 What I know is that somewhere in the build, I get the following message: 我所知道的是在构建中的某处,我收到以下消息:

debug:   accept: ../../../../../../bower_components/google-signin/google-signin.css
error:   Promise rejection: Error: file path is not in root: /bower_components/google-signin/google-signin.css (/path/to/project/root)
error:   Error: file path is not in root: /bower_components/google-signin/google-signin.css (/path/to/project/root)
    at Object.urlFromPath (/usr/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/path-transformers.js:41:15)
    at StreamAnalyzer.getFile (/usr/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:107:39)
    at StreamResolver.accept (/usr/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:210:34)
    at FileLoader.request (/usr/lib/node_modules/polymer-cli/node_modules/hydrolysis/lib/loader/file-loader.js:64:27)
    at Vulcan.<anonymous> (/usr/lib/node_modules/polymer-cli/node_modules/vulcanize/lib/vulcan.js:377:26)
    at Array.map (native)
    at Vulcan.inlineCss (/usr/lib/node_modules/polymer-cli/node_modules/vulcanize/lib/vulcan.js:365:33)
    at Vulcan.<anonymous> (/usr/lib/node_modules/polymer-cli/node_modules/vulcanize/lib/vulcan.js:486:21)

The number of ../ s corresponds to the depth of my project root, ie, the absolute path it is searching for is /bower_components/google-signin/google-signin.css . ../ s的数量对应于我的项目根目录的深度,即它要搜索的绝对路径是/bower_components/google-signin/google-signin.css If I move the project to a different directory at a different depth, it changes accordingly. 如果我将项目移到不同深度的其他目录,则会相应更改。

The error depends solely on this line in my custom element for the main app container (ie, exactly one instance of it lives in the index.html file and it is a direct child of <body> ): 该错误仅取决于主应用容器的我自定义元素中的这一行(即,它的一个实例恰好位于index.html文件中,并且是<body>的直接子代):

<link rel="import" href="../../bower_components/google-signin/google-signin.html">

I've commented out all uses of <google-signin> , but the error still exists. 我已注释掉<google-signin>所有用法,但该错误仍然存​​在。 I've put it in every position within the imports section of my code. 我已经将其放在代码导入部分的每个位置。 If I comment out that line, the build succeeds. 如果我注释掉那条线,则构建成功。

I created a new project using the starter kit and added a <google-signin> element to it. 我使用入门工具包创建了一个新项目,并向其中添加了一个<google-signin>元素。 Building that project passed. 建立项目已通过。 I copied the bower_components folder from that project into my own. 我将那个项目的bower_components文件夹复制到了自己的文件夹中。 The build still failed. 构建仍然失败。

Searching for solutions, I found this answer on stackoverflow and tried it to no avail. 在寻找解决方案时,我在stackoverflow上找到了这个答案,并尝试无济于事。

I've used nodejs and bower from both npm as well as my operating system's package manager. 我已经从npm和操作系统的软件包管理器中使用过nodejsbower

I should also note that the application is fully functional within the development server, eg, polymer serve --open . 我还应注意,该应用程序在开发服务器中具有全部功能,例如, polymer serve --open

I've posted my bower dependencies below. 我在下面发布了我的bower依赖项。 My system is running Arch Linux and the last full system update was yesterday. 我的系统正在运行Arch Linux,最近的完整系统更新是昨天。 The build was not working before the update, either. 在更新之前,该构建也不起作用。

{
  "name": "PROJECT_NAME",
  "description": "Web Front-end for PROJECT_NAME",
  "main": "index.html",
  "dependencies": {
    "iron-elements": "PolymerElements/iron-elements#^1.0.10",
    "paper-elements": "PolymerElements/paper-elements#^1.0.7",
    "app-elements": "PolymerElements/app-elements#^0.10.1",
    "google-signin": "GoogleWebComponents/google-signin#^1.3.7"
  },
  "devDependencies": {}
}

Further, here is a complete list of imports used by the file: 此外,这是文件使用的导入的完整列表:

<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/font-roboto/roboto.html">
<link rel="import" href="../../bower_components/iron-icons/iron-icons.html">

<link rel="import" href="../../bower_components/google-signin/google-signin.html">

<link rel="import" href="../../bower_components/app-layout/app-drawer-layout/app-drawer-layout.html">
<link rel="import" href="../../bower_components/app-layout/app-drawer/app-drawer.html">

<link rel="import" href="../../bower_components/app-layout/app-header-layout/app-header-layout.html">
<link rel="import" href="../../bower_components/app-layout/app-header/app-header.html">

<link rel="import" href="../../bower_components/app-layout/app-toolbar/app-toolbar.html">

<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
<link rel="import" href="../../bower_components/paper-dialog/paper-dialog.html">

我的polymer.json文件未包含所有必需的fragments ,这导致了错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 聚合物组件Google登录无法触发事件? - Polymer component google-signin not firing events? 聚合物google-signin元素获取无法读取null的属性“ currentUser” - Polymer google-signin element gets Cannot read property 'currentUser' of null 使用google-signin而不使用元数据标签 - Using google-signin without metadata tags 使用 google-signin 成功登录后如何重定向 - How to redirect after a successful login with google-signin 在没有 class=&quot;g-signin2&quot; div 的情况下使用 google-signin 时如何使用 GoogleAuth.then() - How do I use GoogleAuth.then() when using google-signin without a class="g-signin2" div 将Polymer项目.5迁移到1.0错误 - Migrating Polymer project .5 to 1.0 error Firebase 谷歌登录身份验证和弹出窗口在 React 项目中不起作用 - Firebase google signin authentication and popup is not working in React project 甚至在Google官方测试页上的Google Plus登录按钮错误 - Google Plus Signin Button error even on google official test page 在React Native中添加Google登录库时出错 - Error while adding google signin lib in react native 使用 gatsby 解决 netlify 上的 firebase 身份验证(谷歌登录)部署错误 - Resolve firebase authentication (google signIn) deploy error on netlify with gatsby
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM