Karma Webpack错误-路径”参数必须为字符串类型

时间:2018-09-07 13:09:14

标签: webpack karma-runner karma-webpack

我正在尝试将Karma添加到项目中,但在webpack步骤中失败。

当我尝试将Webpack配置为由Karma调用时,出现错误:

Scanner s=new Scanner(System.in);
int m=s.nextInt();
s.nextLine();
String str=s.nextLine();
StringTokenizer st=new StringTokenizer(str);
int len=st.countTokens();
int a[]=new int[len];
String []temp=new String[len];
for(int i=0;i<len;i++)
{
    temp[i]=st.nextToken();
    a[i]=Integer.parseInt(temp[i]);
}
    Arrays.sort(a);

// Init a new array.
for(int i=0;i<len-1;i++)
{
    for(int j=i+1;j<len;j++)
    {
        if((a[i]+a[j])==m) {
            // if(new array contains a[i]) continue;
            //array.add(a[i]);
            //array.add(a[j]);
            System.out.println(a[i]+" "+a[j]);
        }
    }
}

我(认为)我将其范围缩小到以下行:

07 09 2018 13:52:41.487:ERROR [karma]: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
    at assertPath (path.js:39:11)
    at Object.join (path.js:434:7)
    at webpackPlugin.readFile (C:\Users\Toby\Documents\GitHub\cncjs-testing2\node_modules\karma-webpack\lib\karma-webpack.js:318:30)
    at Plugin.<anonymous> (C:\Users\Toby\Documents\GitHub\cncjs-testing2\node_modules\karma-webpack\lib\karma-webpack.js:276:17)
    at Plugin.readFile (C:\Users\Toby\Documents\GitHub\cncjs-testing2\node_modules\karma-webpack\lib\karma-webpack.js:293:9)
    at process._tickCallback (internal/process/next_tick.js:61:11)

哪里

let outputPath = webpackPlugin.outputs[filename];

webpackPlugin.outputs = { 'test/web/tests.webpack.jsx': 'output.js' }

因此,斜线是错误的方式,但是我不知道我该怎么做才能导致此错误。

对于感兴趣的任何人,该项目都是CNCjs

0 个答案:

没有答案