lektor-webpack-support
lektor-webpack-support copied to clipboard
Webpack has been initialised using a configuration object that does not match the API schema.
Following the readme guide and launching lektor with lektor server -f webpack it returns the following error:
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.resolve has an unknown property 'modulesDirectories'. These properties are valid:
object { alias?, aliasFields?, cachePredicate?, descriptionFiles?, enforceExtension?, enforceModuleExtension?, extensions?, fileSystem?, mainFields?, mainFiles?, moduleExtensions?, modules?, plugins?, resolver?, symlinks?, unsafeCache?, useSyncFileSystemCalls? }
- configuration.resolve.extensions[0] should not be empty.
seems like readme example was wrote before webpack 2.x. So npm install --save-dev command install latest webpack version and webpack 2.x has a different api. You need to change:
resolve: {
modulesDirectories: [...]
}
to something like this:
resolve: {
modules: [...]
}
(maybe this solution leads to another problem) I think the best way is to fix the right version on npm install command.
As @StefanYohansson mentioned already this is a web pack two issue and can be resolved for the time being with version pinning. See: https://github.com/lektor/lektor-webpack-support/issues/14