A JavaScript error occurred in the main process
Uncaught Exception:
TypeError: Class extends value undefined is not a constructor or null
at Object../node_modules/ipfs-utils/src/http/fetch.browser.js (/home/marco/webMatters
/electronMatters/IpfsPlaying/.webpack/main/index.js:78261:31)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
at Object../node_modules/ipfs-utils/src/http.js (/home/marco/webMatters/electronMatters
/IpfsPlaying/.webpack/main/index.js:77717:37)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
at Object../node_modules/ipfs-utils/src/files/url-source.js (/home/marco/webMatters
/electronMatters/IpfsPlaying/.webpack/main/index.js:77673:14)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
at Object../node_modules/ipfs-core/src/index.js (/home/marco/webMatters/electronMatters
/IpfsPlaying/.webpack/main/index.js:70261:19)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
at Object../node_modules/ipfs/src/index.js (/home/marco/webMatters/electronMatters
/IpfsPlaying/.webpack/main/index.js:78402:23)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
I tried to change within /tools/webpack/webpack.renderer.js :
the target from ‘web’, which was fine when the ipfs-related code was in the renderer process, to ‘electron-main’, but the problem persists.
A JavaScript error occurred in the main process
Uncaught Exception:
TypeError: Class extends value undefined is not a constructor or null
at Object../node_modules/ipfs-utils/src/http/fetch.browser.js (/home/marco/webMatters
/electronMatters/IpfsPlaying/.webpack/main/index.js:16153:31)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
at Object../node_modules/ipfs-utils/src/http.js (/home/marco/webMatters/electronMatters
/IpfsPlaying/.webpack/main/index.js:15609:37)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
at Object../node_modules/ipfs-utils/src/files/url-source.js (/home/marco/webMatters
/electronMatters/IpfsPlaying/.webpack/main/index.js:15565:14)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
at Object../node_modules/ipfs-http-client/src/index.js (/home/marco/webMatters/electronMatters
/IpfsPlaying/.webpack/main/index.js:12181:19)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
at Module../src/main.ts (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:27609:74)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
A JavaScript error occurred in the main process
Uncaught Exception:
TypeError: Class extends value undefined is not a constructor or null
at Object../node_modules/ipfs-utils/src/http/fetch.browser.js (/home/marco/webMatters
/electronMatters/IpfsPlaying/.webpack/main/index.js:84284:31)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
at Object../node_modules/ipfs-utils/src/http.js (/home/marco/webMatters/electronMatters
/IpfsPlaying/.webpack/main/index.js:83740:37)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
at Object../node_modules/ipfs-utils/src/files/url-source.js (/home/marco/webMatters
/electronMatters/IpfsPlaying/.webpack/main/index.js:83696:14)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
at Object../node_modules/ipfs-core/src/index.js (/home/marco/webMatters/electronMatters
/IpfsPlaying/.webpack/main/index.js:70420:19)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
at Object../node_modules/ipfs/src/index.js (/home/marco/webMatters/electronMatters
/IpfsPlaying/.webpack/main/index.js:84425:23)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
I guess there is something to fix within webpack configuration
I tried to change in webpack.main.js the target from electron-renderer to `electron-main’
but got new error:
module.exports = {
/**
* This is the main entry point for your application, it's the first file
* that runs in the main process.
*/
entry: ['./src/main.ts'],
// Put your normal webpack config below here
module: {
rules: require('./webpack.rules'),
},
resolve: {
extensions: ['.js', '.ts', '.jsx', '.tsx', '.css', '.json'],
alias: require('./webpack.aliases'),
},
// https://github.com/electron/electron/issues/9920
//target: 'electron-renderer'
target: 'electron-main'
};
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Module build failed (from ./node_modules/@marshallofsound/webpack-asset-relocator-loader
/dist/index.js):
SyntaxError: Unexpected token (85:14)
at Object.module.exports.pp$4.raise (/home/marco/webMatters/electronMatters/IpfsPlaying
/node_modules/@marshallofsound/webpack-asset-relocator-loader/dist/index.js:20834:13)
at Object.module.exports.pp.unexpected (/home/marco/webMatters/electronMatters/IpfsPlaying
/node_modules/@marshallofsound/webpack-asset-relocator-loader/dist/index.js:18680:8)
at Object.module.exports.pp$1.parseTryStatement (/home/marco/webMatters/electronMatters
/IpfsPlaying/node_modules/@marshallofsound/webpack-asset-relocator-loader
/dist/index.js:19069:49)
at Object.module.exports.pp$1.parseStatement (/home/marco/webMatters/electronMatter
s/IpfsPlaying/node_modules/@marshallofsound/webpack-asset-relocator-loader
/dist/index.js:18834:32)
at Object.parseStatement (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules
/@marshallofsound/webpack-asset-relocator-loader/dist/index.js:4539:118)
at Object.parseStatement (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules
/@marshallofsound/webpack-asset-relocator-loader/dist/index.js:42314:22)
at Object.module.exports.pp$1.parseBlock (/home/marco/webMatters/electronMatters
/IpfsPlaying/node_modules/@marshallofsound/webpack-asset-relocator-loader
/dist/index.js:19157:23)
at Object.module.exports.pp$1.parseTryStatement (/home/marco/webMatters/electronMatters
/IpfsPlaying/node_modules/@marshallofsound/webpack-asset-relocator-loader
/dist/index.js:19073:24)
at Object.module.exports.pp$1.parseStatement (/home/marco/webMatters/electronMatters
/IpfsPlaying/node_modules/@marshallofsound/webpack-asset-relocator-loader
/dist/index.js:18834:32)
at Object.parseStatement (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules
/@marshallofsound/webpack-asset-relocator-loader/dist/index.js:4539:118)
at Object.parseStatement (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules
/@marshallofsound/webpack-asset-relocator-loader/dist/index.js:42314:22)
at Object.module.exports.pp$1.parseBlock (/home/marco/webMatters/electronMatters
/IpfsPlaying/node_modules/@marshallofsound/webpack-asset-relocator-loader
/dist/index.js:19157:23)
at Object.module.exports.pp$3.parseFunctionBody (/home/marco/webMatters/electronMatters
/IpfsPlaying/node_modules/@marshallofsound/webpack-asset-relocator-loader
/dist/index.js:20675:22)
at Object.module.exports.pp$3.parseArrowExpression (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules/@marshallofsound/webpack-asset-relocator-loader
/dist/index.js:20638:8)
at Object.module.exports.pp$3.parseExprAtom (/home/marco/webMatters/electronMatters
/IpfsPlaying/node_modules/@marshallofsound/webpack-asset-relocator-loader
/dist/index.js:20227:21)
at Object.parseExprAtom (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules
/@marshallofsound/webpack-asset-relocator-loader/dist/index.js:4551:117)
at Object../node_modules/fs-extra/lib/mkdirs/make-dir.js (/home/marco/webMatters
/electronMatters/IpfsPlaying/.webpack/main/index.js:77510:7)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
at Object../node_modules/fs-extra/lib/mkdirs/index.js (/home/marco/webMatters/electronMatters
/IpfsPlaying/.webpack/main/index.js:77487:44)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
at Object../node_modules/fs-extra/lib/copy-sync/copy-sync.js (/home/marco/webMatters
/electronMatters/IpfsPlaying/.webpack/main/index.js:76425:20)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
at Object../node_modules/fs-extra/lib/copy-sync/index.js (/home/marco/webMatters
/electronMatters/IpfsPlaying/.webpack/main/index.js:76602:13)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
at Object../node_modules/fs-extra/lib/index.js (/home/marco/webMatters/electronMatters
/IpfsPlaying/.webpack/main/index.js:77353:6)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:21:30)
webpack built faabfd532de4c5a09a71 in 5350ms
module.exports = {
/**
* This is the main entry point for your application, it's the first file
* that runs in the main process.
*/
entry: ['./src/main.ts'],
// Put your normal webpack config below here
module: {
rules: require('./webpack.rules'),
},
resolve: {
extensions: ['.js', '.ts', '.jsx', '.tsx', '.css', '.json'],
alias: require('./webpack.aliases'),
},
// https://github.com/electron/electron/issues/9920
//target: 'electron-renderer'
target: 'electron-main'
};
import Ipfs from 'ipfs';
import IpfsHttpClient from 'ipfs-http-client';
But when I add this line:
const { globSource } = IpfsHttpClient;
I get this error:
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Module build failed (from ./node_modules/@marshallofsound/webpack-asset-relocator-loader/dist/index.js):
SyntaxError: Unexpected token (85:14)
at Object.module.exports.pp$4.raise (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules
/@marshallofsound/webpack-asset-relocator-loader/dist/index.js:20834:13)
at Object.module.exports.pp.unexpected (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules
/@marshallofsound/webpack-asset-relocator-loader/dist/index.js:18680:8)
at Object.module.exports.pp$1.parseTryStatement (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules
/@marshallofsound/webpack-asset-relocator-loader/dist/index.js:19069:49)
at Object.module.exports.pp$1.parseStatement (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules
/@marshallofsound/webpack-asset-relocator-loader/dist/index.js:18834:32)
at Object.parseStatement (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules/@marshallofsound
/webpack-asset-relocator-loader/dist/index.js:4539:118)
at Object.parseStatement (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules/@marshallofsound
/webpack-asset-relocator-loader/dist/index.js:42314:22)
at Object.module.exports.pp$1.parseBlock (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules
/@marshallofsound/webpack-asset-relocator-loader/dist/index.js:19157:23)
at Object.module.exports.pp$1.parseTryStatement (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules
/@marshallofsound/webpack-asset-relocator-loader/dist/index.js:19073:24)
at Object.module.exports.pp$1.parseStatement (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules
/@marshallofsound/webpack-asset-relocator-loader/dist/index.js:18834:32)
at Object.parseStatement (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules/@marshallofsound
/webpack-asset-relocator-loader/dist/index.js:4539:118)
at Object.parseStatement (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules/@marshallofsound
/webpack-asset-relocator-loader/dist/index.js:42314:22)
at Object.module.exports.pp$1.parseBlock (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules
/@marshallofsound/webpack-asset-relocator-loader/dist/index.js:19157:23)
at Object.module.exports.pp$3.parseFunctionBody (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules
/@marshallofsound/webpack-asset-relocator-loader/dist/index.js:20675:22)
at Object.module.exports.pp$3.parseArrowExpression (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules
/@marshallofsound/webpack-asset-relocator-loader/dist/index.js:20638:8)
at Object.module.exports.pp$3.parseExprAtom (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules
/@marshallofsound/webpack-asset-relocator-loader/dist/index.js:20227:21)
at Object.parseExprAtom (/home/marco/webMatters/electronMatters/IpfsPlaying/node_modules/@marshallofsound
/webpack-asset-relocator-loader/dist/index.js:4551:117)
at Object../node_modules/fs-extra/lib/mkdirs/make-dir.js (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:13240:7)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack/main/index.js:21:30)
at Object../node_modules/fs-extra/lib/mkdirs/index.js (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:13217:44)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack/main/index.js:21:30)
at Object../node_modules/fs-extra/lib/copy-sync/copy-sync.js (/home/marco/webMatters/electronMatters/IpfsPlaying
/.webpack/main/index.js:12155:20)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack/main/index.js:21:30)
at Object../node_modules/fs-extra/lib/copy-sync/index.js (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:12332:13)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack/main/index.js:21:30)
at Object../node_modules/fs-extra/lib/index.js (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack
/main/index.js:13083:6)
at __webpack_require__ (/home/marco/webMatters/electronMatters/IpfsPlaying/.webpack/main/index.js:21:30)
Anyway… thank you very much for your kind help.
I’m going to try to solve the issue