aws -amplify / analytics TypeError при миграции на TypeScript - PullRequest
0 голосов
/ 10 марта 2020

Я пытаюсь перенести мое aws -усилительное приложение реакции на TypeScript из JS. Мне удалось настроить новый набор для компиляции, но когда я go в браузере, я вижу следующую ошибку:

TypeError: Object prototype may only be an Object or null: undefined
extendStatics
node_modules/@aws-amplify/analytics/lib-esm/Providers/AWSKinesisFirehoseProvider.js:18
  15 |     extendStatics = Object.setPrototypeOf ||
  16 |         ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17 |         function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
> 18 |     return extendStatics(d, b);
  19 | };
  20 | return function (d, b) {
  21 |     extendStatics(d, b);
View compiled
./node_modules/@aws-amplify/analytics/lib-esm/Providers/AWSKinesisFirehoseProvider.js.__extends
node_modules/@aws-amplify/analytics/lib-esm/Providers/AWSKinesisFirehoseProvider.js:21
  18 |     return extendStatics(d, b);
  19 | };
  20 | return function (d, b) {
> 21 |     extendStatics(d, b);
  22 |     function __() { this.constructor = d; }
  23 |     d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  24 | };
View compiled
(anonymous function)
node_modules/@aws-amplify/analytics/lib-esm/Providers/AWSKinesisFirehoseProvider.js:31
  28 | import * as Firehose from 'aws-sdk/clients/firehose';
  29 | var logger = new Logger('AWSKineisFirehoseProvider');
  30 | var AWSKinesisFirehoseProvider = /** @class */ (function (_super) {
> 31 |     __extends(AWSKinesisFirehoseProvider, _super);
  32 |     function AWSKinesisFirehoseProvider(config) {
  33 |         return _super.call(this, config) || this;
  34 |     }
View compiled
./node_modules/@aws-amplify/analytics/lib-esm/Providers/AWSKinesisFirehoseProvider.js
node_modules/@aws-amplify/analytics/lib-esm/Providers/AWSKinesisFirehoseProvider.js:100
   97 |         return true;
   98 |     };
   99 |     return AWSKinesisFirehoseProvider;
> 100 | }(AWSKinesisProvider));
  101 | export default AWSKinesisFirehoseProvider;
  102 | //# sourceMappingURL=AWSKinesisFirehoseProvider.js.map
  103 | 
View compiled
__webpack_require__
/Users/richurley/vs_web_apps/controlsnlp/webpack/bootstrap c5211ad77625db11a471:678
  675 | };
  676 | 
  677 | // Execute the module function
> 678 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
  679 | 
  680 | // Flag the module as loaded
  681 | module.l = true;
View compiled
fn
/Users/richurley/vs_web_apps/controlsnlp/webpack/bootstrap c5211ad77625db11a471:88
  85 |      console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId);
  86 |      hotCurrentParents = [];
  87 |  }
> 88 |  return __webpack_require__(request);
  89 | };
  90 | var ObjectFactory = function ObjectFactory(name) {
  91 |  return {
View compiled
./node_modules/@aws-amplify/analytics/lib-esm/Providers/index.js
node_modules/@aws-amplify/analytics/lib-esm/Providers/index.js:1
> 1 | import AWSPinpointProvider from './AWSPinpointProvider';
  2 | import AWSKinesisProvider from './AWSKinesisProvider';
  3 | import AWSKinesisFirehoseProvider from './AWSKinesisFirehoseProvider';
  4 | import AmazonPersonalizeProvider from './AmazonPersonalizeProvider';
View compiled
__webpack_require__
/Users/richurley/vs_web_apps/controlsnlp/webpack/bootstrap c5211ad77625db11a471:678
  675 | };
  676 | 
  677 | // Execute the module function
> 678 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
  679 | 
  680 | // Flag the module as loaded
  681 | module.l = true;
View compiled
fn
/Users/richurley/vs_web_apps/controlsnlp/webpack/bootstrap c5211ad77625db11a471:88
  85 |      console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId);
  86 |      hotCurrentParents = [];
  87 |  }
> 88 |  return __webpack_require__(request);
  89 | };
  90 | var ObjectFactory = function ObjectFactory(name) {
  91 |  return {
View compiled
./node_modules/@aws-amplify/analytics/lib-esm/index.js
node_modules/@aws-amplify/analytics/lib-esm/index.js:1
> 1 | /*
  2 |  * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3 |  *
  4 |  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
View compiled
__webpack_require__
/Users/richurley/vs_web_apps/controlsnlp/webpack/bootstrap c5211ad77625db11a471:678
  675 | };
  676 | 
  677 | // Execute the module function
> 678 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
  679 | 
  680 | // Flag the module as loaded
  681 | module.l = true;
View compiled
fn
/Users/richurley/vs_web_apps/controlsnlp/webpack/bootstrap c5211ad77625db11a471:88
  85 |      console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId);
  86 |      hotCurrentParents = [];
  87 |  }
> 88 |  return __webpack_require__(request);
  89 | };
  90 | var ObjectFactory = function ObjectFactory(name) {
  91 |  return {
View compiled
./node_modules/aws-amplify/lib-esm/index.js
node_modules/aws-amplify/lib-esm/index.js:1
> 1 | /*
  2 |  * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3 |  *
  4 |  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
View compiled
__webpack_require__
/Users/richurley/vs_web_apps/controlsnlp/webpack/bootstrap c5211ad77625db11a471:678
  675 | };
  676 | 
  677 | // Execute the module function
> 678 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
  679 | 
  680 | // Flag the module as loaded
  681 | module.l = true;
View compiled
fn
/Users/richurley/vs_web_apps/controlsnlp/webpack/bootstrap c5211ad77625db11a471:88
  85 |      console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId);
  86 |      hotCurrentParents = [];
  87 |  }
> 88 |  return __webpack_require__(request);
  89 | };
  90 | var ObjectFactory = function ObjectFactory(name) {
  91 |  return {
View compiled
./src/submit_file.js
src/submit_file.js:1
> 1 | import React, { useState, useContext } from "react";
  2 | import PropTypes from "prop-types";
  3 | import Button from "@material-ui/core/Button";
  4 | import CssBaseline from "@material-ui/core/CssBaseline";
View compiled
▶ 2 stack frames were collapsed.
./src/App.js
src/App.js:1
> 1 | import React, { useState } from "react";
  2 | import "./App.css";
  3 | import SubmitFile from "./submit_file.js";
  4 | import Dashboard from "./dashboard.js";
View compiled
▶ 2 stack frames were collapsed.
./src/index.tsx
src/index.tsx:1
> 1 | import React from 'react';
  2 | import ReactDOM from 'react-dom';
  3 | import './index.css';
  4 | import App from './App';
View compiled
▶ 6 stack frames were collapsed.
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error.

Кажется, что это вызвано @ aws -amplify / аналитика, но я не могу найти основную проблему или что-то не так. Может кто-нибудь помочь, пожалуйста?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...