npm test - ERROR [preprocess]: Can not load "webpack"!
escapedcat opened this issue · 5 comments
escapedcat commented
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
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
@escapedcat i've experiencing this bug too. i will look into it right now.
phra commented
@escapedcat can you try to check if now the problem is gone also for you? thanks.
escapedcat commented
Thanks @phra, works!
And I learned that:
voidcan be used in that waynull-loaderis an actual thing. I didn't see that before
Thanks for that as well!
phra commented
@escapedcat happy to help! 👍