首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >UnhandledPromiseRejectionWarning: ReferenceError:未定义存储

UnhandledPromiseRejectionWarning: ReferenceError:未定义存储
EN

Stack Overflow用户
提问于 2020-03-21 17:21:43
回答 2查看 191关注 0票数 0

我使用docsite来生成标记文档,资源代码...到html页面。现在我想添加一个valine (这是注释框的一个特性。有关详情,请参阅valine.js.org)插件。我使用的是node v10.9.0。下面是我向其中添加代码的文件:

代码语言:javascript
复制
import React from 'react';
window.AV = require('leancloud-storage');
import Valine from 'valine';

class Footer extends Language {

  render() {
    new Valine({
            el: '#vcomments',
            appId: '1',
            appKey: '1'
        });
    return (
      <footer className="footer-container">
        <div className="footer-body">
          <div id="vcomments"></div>
        </div>
      </footer>
    );
  }
}

export default Footer;

下面是我收到的错误:

代码语言:javascript
复制
C:\work\wuhan2020.github.io>npm run start

> site@0.0.1 start C:\work\wuhan2020.github.io
> docsite start

(node:28140) UnhandledPromiseRejectionWarning: ReferenceError: Storage is not defined
    at Object.<anonymous> (C:\work\wuhan2020.github.io\node_modules\_valine@1.3.10@valine\dist\Valine.min.js:12:5096)
    at t (C:\work\wuhan2020.github.io\node_modules\_valine@1.3.10@valine\dist\Valine.min.js:7:316)
    at Object.<anonymous> (C:\work\wuhan2020.github.io\node_modules\_valine@1.3.10@valine\dist\Valine.min.js:12:73397)
    at t (C:\work\wuhan2020.github.io\node_modules\_valine@1.3.10@valine\dist\Valine.min.js:7:316)
    at C:\work\wuhan2020.github.io\node_modules\_valine@1.3.10@valine\dist\Valine.min.js:7:699
    at C:\work\wuhan2020.github.io\node_modules\_valine@1.3.10@valine\dist\Valine.min.js:7:709
    at C:\work\wuhan2020.github.io\node_modules\_valine@1.3.10@valine\dist\Valine.min.js:7:81
    at Object.<anonymous> (C:\work\wuhan2020.github.io\node_modules\_valine@1.3.10@valine\dist\Valine.min.js:7:193)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Module._compile (C:\work\wuhan2020.github.io\node_modules\_pirates@4.0.1@pirates\lib\index.js:99:24)
(node:28140) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
EN

回答 2

Stack Overflow用户

发布于 2020-03-30 17:41:23

确保您在运行npm start之前运行了npm install

票数 0
EN

Stack Overflow用户

发布于 2020-04-15 09:20:32

valine团队已经确认valine本身有问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60786225

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档