I'm running into the below error (in browser):
index.ts:1 Uncaught TypeError: (void 0) is not a function
at eval (index.ts:1)
at Object../src/index.ts (main.js:96)
at __webpack_require__ (main.js:20)
at main.js:84
at main.js:87
I'm having difficulty knowing how to investigate this error. It seems to be the same issue here: Getting error "Void 0 is not function" on browser when using webpack to bundle typescript file
What is this eval("(void 0)(...
in the compiled output?
I'm trying to compile a 'simple' typescript script into a form that can be run by the browser.
The entire MCVE is at this repo: https://github.com/chrissound/newCha
I have the following webpack and typescript config:
webpack.config.js
const path = require('path');
module.exports = {
mode: 'development',
entry: './src/index.ts',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
}
]
},
resolve: {
extensions: [ '.tsx', '.ts', '.js' ]
},
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist')
}
};
tsconfig.json
{
"compilerOptions": {
"sourceMap": true,
"target": "es5",
"outFile": "compiled.js",
"declaration": true,
"removeComments": true,
"module": "system"
},
"include": [
"src/*"
],
"exclude": [
"node_modules",
"**/*.spec.ts"
]
}