javascript - Foutmelding "Void 0 is not function" in de browser bij gebruik van webpack om een typescript-bestand te bundelen
Ik gebruik webpack met versie 4.8.1 om typescript te bundelen dat versie 2.8.1 heeft, maar wanneer ik die gebundelde js in de browser gebruik, krijg ik de fout Void 0 is not function. Hier is mijn webpack.config.js-bestand
var glob = require("glob")module.exports={
entry:{
LiveAgentApplication:"./Scripts/LiveAgent.Application.ts"
},output: {
path:__dirname+'/dist',
filename: '[name].bundle.js'
},module: {
rules: [
{ test: /\.ts$/, loader: 'ts-loader' }
]
},optimization: {
minimize: false
}}
Hier is mijn tsconfig.js
{
"compilerOptions": {
"target": "es5",
"module": "system",
"noImplicitAny": false,
"removeComments": true,
"preserveConstEnums": true,
"outFile": "../../built/local/tsc.js",
"sourceMap": true,
"allowJs": true,
"moduleResolution": "node"
},
"include": [
"./Scripts/*"
],
"exclude": [
"node_modules",
"**/*.spec.ts"
]}
En package.json is als volgt:
{"name": "Resources",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"refreshVSToken ": "vsts-npm-auth -config .npmrc"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"geofluent-bundle": "^1.0.3",
"geofluent-chat-translation-bundle": "^1.0.2",
"geofluent-common-bundle": "^1.0.3",
"geofluent-itranslator-bundle": "^1.0.6",
"geofluent-sdk-bundle": "^1.0.1",
"geofluent-tokenizer-bundle": "^1.0.4",
"install": "^0.11.0",
"jquery": "^3.3.1",
"npm": "^5.8.0",
"ts-loader": "^4.2.0",
"webpack": "^4.8.1",
"webpack-cli": "^2.1.3",
"webpack-system-register": "^1.6.0",
},"devDependencies": {
"@types/jquery": "^3.3.1"
}}
Opmerking: sommige van de knooppuntmodules die ik gebruik, worden gehost op de particuliere NPM-register van onze organisatie