different dhive behaviour under npm vs under straight js environment
For some reason when I run the code that looks like this under the straight Javascript environment (js) under Ubuntu 18 it works just fine,
`import React from 'react'; import Client from '@hiveio/dhive';
const hive_access_url = 'https://api.openhive.network'; const client = new Client( hive_access_url ); const hive_user = 'borepstein'; const post_count = 5;`
However, when I run it under npm I get the following messages spit into the browser:
`TypeError: _hiveio_dhive__WEBPACK_IMPORTED_MODULE_1___default.a is not a constructor ./src/HiveFeed.js src/HiveFeed.js:5
2 | import Client from '@hiveio/dhive'; 3 | 4 | const hive_access_url = 'https://api.openhive.network';
5 | const client = new Client( hive_access_url ); 6 | const hive_user = 'borepstein'; 7 | const post_count = 5; 8 |
webpack_require /home/bepstein/borisepstein-info/webpack/bootstrap:784
781 | }; 782 | 783 | // Execute the module function
784 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); | ^ 785 | 786 | // Flag the module as loaded 787 | module.l = true;
fn /home/bepstein/borisepstein-info/webpack/bootstrap:150
147 | ); 148 | hotCurrentParents = []; 149 | }
150 | return webpack_require(request); | ^ 151 | }; 152 | var ObjectFactory = function ObjectFactory(name) { 153 | return {
./src/App.js https://10.0.3.23:3443/static/js/main.chunk.js:25260:86 webpack_require /home/bepstein/borisepstein-info/webpack/bootstrap:784
781 | }; 782 | 783 | // Execute the module function
784 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); | ^ 785 | 786 | // Flag the module as loaded 787 | module.l = true;
fn /home/bepstein/borisepstein-info/webpack/bootstrap:150
147 | ); 148 | hotCurrentParents = []; 149 | }
150 | return webpack_require(request); | ^ 151 | }; 152 | var ObjectFactory = function ObjectFactory(name) { 153 | return {
./src/index.js https://10.0.3.23:3443/static/js/main.chunk.js:25678:81 webpack_require /home/bepstein/borisepstein-info/webpack/bootstrap:784
781 | }; 782 | 783 | // Execute the module function
784 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); | ^ 785 | 786 | // Flag the module as loaded 787 | module.l = true;
fn /home/bepstein/borisepstein-info/webpack/bootstrap:150
147 | ); 148 | hotCurrentParents = []; 149 | }
150 | return webpack_require(request); | ^ 151 | }; 152 | var ObjectFactory = function ObjectFactory(name) { 153 | return {
1 https://10.0.3.23:3443/static/js/main.chunk.js:25821:18 webpack_require /home/bepstein/borisepstein-info/webpack/bootstrap:784
781 | }; 782 | 783 | // Execute the module function
784 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); | ^ 785 | 786 | // Flag the module as loaded 787 | module.l = true;
checkDeferredModules /home/bepstein/borisepstein-info/webpack/bootstrap:45
42 | } 43 | if(fulfilled) { 44 | deferredModules.splice(i--, 1);
45 | result = webpack_require(webpack_require.s = deferredModule[0]); | ^ 46 | } 47 | } 48 |
webpackJsonpCallback /home/bepstein/borisepstein-info/webpack/bootstrap:32
29 | deferredModules.push.apply(deferredModules, executeModules || []); 30 | 31 | // run deferred modules when all chunks ready
32 | return checkDeferredModules(); | ^ 33 | }; 34 | function checkDeferredModules() { 35 | var result;
(anonymous function) https://10.0.3.23:3443/static/js/main.chunk.js:1:87 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. Click the 'X' or hit ESC to dismiss this message.`
Any help with debugging this would be appreciated.
Thanks.
Boris.