Uncaught SyntaxError:意外的令牌'导出'-Karma配置设置-Angular.js 1.x-javascript

问题描述

为了解决以下错误,需要在karma.config下面进行哪些更改

 module.exports = function(config) {
config.set({
    basePath: '',frameworks: ['jasmine'],files: [
        
       // 'node_modules/@zxing/library/*.js'
       // 'assets/@zxing/library/esm/browser/browserMultiFormatReader.js'
       'assets/@zxing/library/*.js',],exclude: [
        "assets/other.min.js"
    ],preprocessors: {
        'app/**/*.html': "ng-html2js",'app/views/**/!(*spec).js': ['coverage']
    },reporters: ['progress','html','coverage'],port: 3000,colors: true,autoWatch: true,browsers: ['Chrome'],singleRun: true,concurrency: Infinity,coverageReporter : {
      type : 'html',dir : 'coverage/',subdir: '.',check: {
            global: {
                ....,.....
            },each: {
               ....,....
            }
        }
    },htmlReporter: {
        outputDir: 'karma_html',namedFiles: true,reportName: 'sample_spec_report' 
    }
})

}

错误

Chrome 85.0.4183 (Windows 10.0.0) ERROR
  Uncaught SyntaxError: Unexpected token 'export'
  at assets/@zxing/library/esm/browser.js:2

Chrome 85.0.4183 (Windows 10.0.0) ERROR
  Uncaught SyntaxError: Unexpected token 'export'
  at assets/@zxing/library/esm/browser.js:2

JavaScript Test Case Exit Code 1
JavaScript Test Case Fails

我正在尝试在我的 Angular.1x 应用中使用zxing.js。由于此错误,我的CI / CD失败。库在应用内正常运行。我在使用gulp karmaRunDebug时就面临着这个问题。因此需要专家的意见来解决此问题。我在努力解决过去两个问题。

我不知道需要做什么,因为这是全新的gulp和karma测试环境。

zxing-> library

谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)