preboot / angularjs-webpack

A complete, yet simple, starter for AngularJS using webpack
MIT License
1.71k stars 658 forks source link

npm test - ERROR [preprocess]: Can not load "webpack"! #69

Closed escapedcat closed 7 years ago

escapedcat commented 7 years ago

I checked out the latest master (after the webpack2 update).

When I run npm test I get this and some more error messages:

> angular-webpack-workflow@1.1.0 test /home/hannes/data/www/angular-webpack
> karma start

31 01 2017 13:12:09.158:ERROR [preprocess]: Can not load "webpack"!
  WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.entry should be one of these:
   object { <key>: non-empty string | [non-empty string] } | non-empty string | [non-empty string] | function
   The entry point(s) of the compilation.
   Details:
    * configuration.entry should NOT have less than 1 properties ({
        "keyword": "minProperties",
        "dataPath": ".entry",
        "schemaPath": "#/oneOf/0/minProperties",
        "params": {
          "limit": 1
        },
        "message": "should NOT have less than 1 properties",
        "schema": 1,
        "parentSchema": {
          "minProperties": 1,
          "additionalProperties": {
            "oneOf": [
              {
                "description": "The string is resolved to a module which is loaded upon startup.",
                "minLength": 1,
                "type": "string"
              },
              {
                "description": "All modules are loaded upon startup. The last one is exported.",
                "$ref": "#/definitions/common.nonEmptyArrayOfUniqueStringValues"
              }
            ]
          },
          "description": "Multiple entry bundles are created. The key is the chunk name. The value can be a string or an array.",
          "type": "object"
        },
        "data": {}
      }).
      object { <key>: non-empty string | [non-empty string] }
      Multiple entry bundles are created. The key is the chunk name. The value can be a string or an array.
    * configuration.entry should be a string.
    * configuration.entry should be an array:
      [non-empty string]
    * configuration.entry should be an instance of function
      function returning an entry object or a promise..

Anyone else is having the same issue?
Did I miss something?
I'm running node version 5.8.0 on Linux Mint.

escapedcat commented 7 years ago

This seems to be related to Can not load 'webpack' - issue with v2.1.0 #210.

Changing these two parts in webpack.config.js make the tests work but they fail due to missing css:

  if (!isTest) {
    config.entry = {
      app: './src/app/app.js'
    };
  };
// loader: isTest ? 'null' : ExtractTextPlugin.extract({
//   fallbackLoader: 'style-loader',
//   loader: [
//     {loader: 'css-loader', query: {sourceMap: true}},
//     {loader: 'postcss-loader'}
//   ],
// })
phra commented 7 years ago

@escapedcat i've experiencing this bug too. i will look into it right now.

phra commented 7 years ago

@escapedcat can you try to check if now the problem is gone also for you? thanks.

escapedcat commented 7 years ago

Thanks @phra, works!

And I learned that:

Thanks for that as well!

phra commented 7 years ago

@escapedcat happy to help! 👍