Giter Site home page Giter Site logo

Comments (24)

joeheyming avatar joeheyming commented on May 14, 2024 9

wow, this whole time I wasn't using node_modules/.bin/karma and was instead using the global karma.

Just wanted to say this in case anyone else had the same issue.

from karma-webpack.

dignifiedquire avatar dignifiedquire commented on May 14, 2024 8

@pojka @jingzhou123 I've just checked you repo and everything is working fine for me, I ran

$ npm install
$ node_modules/.bin/karma start karma.conf.js

Could you check that you are using karma-cli and not karma installed globally, and make sure the global version which you call with karma is actually up to date.

from karma-webpack.

besh avatar besh commented on May 14, 2024 1

@joeheyming Good call out. Didn't even think of that. Completely fixed my issues.

from karma-webpack.

dignifiedquire avatar dignifiedquire commented on May 14, 2024

Duplicate of #68 and see #63 for more details. You need to upgrade karma to 0.13 to fix the issue

from karma-webpack.

pojka avatar pojka commented on May 14, 2024

I'm seeing this issue with fixed versions of karma 0.13.4 and karma-webpack 1.7.0

Can not load "webpack"!
  TypeError: undefined is not a function
    at Plugin.notifyKarmaAboutChanges (/Projects/utilass/node_modules/karma-webpack/index.js:108:15)

from karma-webpack.

dignifiedquire avatar dignifiedquire commented on May 14, 2024

@pojka could you show me the output of npm ls please

from karma-webpack.

pojka avatar pojka commented on May 14, 2024

@dignifiedquire sure - https://gist.github.com/pojka/49307fbb77d1c0ee18ed

Please let me know if I'm being dumb :)

from karma-webpack.

dignifiedquire avatar dignifiedquire commented on May 14, 2024

@pojka looks like there is another bug in there :( thanks for the report

from karma-webpack.

kmaraz avatar kmaraz commented on May 14, 2024

I have the same problem, how can I temporarily solve this? Or I need to wait for fix? Thanks.

EDIT: Or can I help you with my logs?

from karma-webpack.

pojka avatar pojka commented on May 14, 2024

@kmaraz using the following combination works for me for the moment:

"karma": "0.12.37", "karma-webpack": "1.6.0",

from karma-webpack.

kmaraz avatar kmaraz commented on May 14, 2024

@pojka Thanks!
@dignifiedquire If you need my logs, just tell me, please.

from karma-webpack.

andrevinsky avatar andrevinsky commented on May 14, 2024

Hello, isn't there a way NOT to use old versions? 👍

from karma-webpack.

leoselig avatar leoselig commented on May 14, 2024

+1
we are experiencing the same issue

from karma-webpack.

dignifiedquire avatar dignifiedquire commented on May 14, 2024

Does someone have repo which fails with this error, using [email protected] and [email protected] that I could look at?

from karma-webpack.

ebordeau avatar ebordeau commented on May 14, 2024

I updated to [email protected] and [email protected] and it worked for me. Thanks!

from karma-webpack.

pojka avatar pojka commented on May 14, 2024

@dignifiedquire not working for me with [email protected] and [email protected] either

I've stripped everything down to a very basic config and a hello world test, repo is here - https://github.com/pojka/debug-karma-webpack-70

If you change to [email protected] and [email protected] the test runs

from karma-webpack.

thomasklein avatar thomasklein commented on May 14, 2024

Hi! [email protected] and [email protected] also did not work for me, so I downgraded to [email protected] and [email protected] and it triggers the following error (which I think is new in the current stack of error messages and might therefore have another cause):

WARN [preprocess]: Can not load "webpack"!
  Error: Invalid arguments: 'delay'
    at NodeWatchFileSystem.watch (/xxx/node_modules/webpack/lib/node/NodeWatchFileSystem.js:29:9)
    at Watching.watch (/xxx/node_modules/webpack/lib/Compiler.js:86:47)
    at Watching._done (/xxx/node_modules/webpack/lib/Compiler.js:82:8)
    at Watching.<anonymous> (/xxx/node_modules/webpack/lib/Compiler.js:60:18)
    at Tapable.emitRecords (/xxx/node_modules/webpack/lib/Compiler.js:279:37)
    at Watching.<anonymous> (/xxx/node_modules/webpack/lib/Compiler.js:57:19)
    at /xxx/node_modules/webpack/lib/Compiler.js:272:11
    at Tapable.applyPluginsAsync (/xxx/node_modules/webpack/node_modules/tapable/lib/Tapable.js:60:69)
    at Tapable.afterEmit (/xxx/node_modules/webpack/lib/Compiler.js:269:8)
    at Tapable.<anonymous> (/xxx/node_modules/webpack/lib/Compiler.js:264:14)

with the karma.config

module.exports = function(config) {
    config.set({

        // base path that will be used to resolve all patterns (eg. files, exclude)
        basePath: pathToSrcJS,

        // frameworks to use
        // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
        frameworks: ['jasmine'],

        // list of files / patterns to load in the browser
        files: [
            // project specific SETUP necessary for tests
            'components_tests/setup.js',

            // include all test files
            'components_tests/test_index.js'
        ],
        // preprocess matching files before serving them to the browser
        // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
        preprocessors: {
            'components_tests/test_index.js': ['webpack', 'coverage'],
            'components_tests/setup.js': ['webpack']
        },

        // list of files to exclude
        exclude: [],

        // TODO refactor path and make them project agnostic
        webpack: webpackConfig,

        // test results reporter to use
        // possible values: 'dots', 'progress'
        // available reporters: https://npmjs.org/browse/keyword/karma-reporter
        reporters: ['progress', 'coverage'],

        // web server port
        port: 9876,

        // enable / disable colors in the output (reporters and logs)
        colors: true,

        // Output summary only to console
        // Webstorm/Intellij have an integrated coverage view
        coverageReporter: {
            reporters: [{
                type: 'text'
            }]
        },

        // level of logging
        // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
        logLevel: config.LOG_INFO,

        // enable / disable watching file and executing tests whenever any file changes
        autoWatch: false,

        // start these browsers
        // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
        browsers: ['PhantomJS'],

        // Continuous Integration mode
        // if true, Karma captures browsers, runs the tests and exits
        singleRun: true,

        plugins: [
            require('karma-phantomjs-launcher'),
            require('karma-webpack'),
            require('karma-jasmine'),
            require('karma-coverage')
        ]
    });
};

from karma-webpack.

thomasklein avatar thomasklein commented on May 14, 2024

My problem was solved by upgrading to the latest version of webpack.

from karma-webpack.

claudiopro avatar claudiopro commented on May 14, 2024

Same issue here. I'm running a clone of https://github.com/pheuter/essential-react with

Full output of npm ls here

from karma-webpack.

dignifiedquire avatar dignifiedquire commented on May 14, 2024

@claudiopro you need to upgrade karma to 0.13

from karma-webpack.

claudiopro avatar claudiopro commented on May 14, 2024

@dignifiedquire thanks, [email protected] did solve the issue!

from karma-webpack.

pojka avatar pojka commented on May 14, 2024

@dignifiedquire that was indeed the issue, thank you for your patience!

from karma-webpack.

dignifiedquire avatar dignifiedquire commented on May 14, 2024

Closing this as all issues seem to have been resolved.

from karma-webpack.

yinsang avatar yinsang commented on May 14, 2024

Two ways to use karma start.

  1. if you had done npm install -g karma-cli, you can use karma start directly in commander(not in package.json)

  2. if you use npm scripts like
    "scripts": {
    "test": "karma start"
    },

, try npm install -SD karma-webpack webpack,then usenpm run test

from karma-webpack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.