I've just installed webpacker on my Rails 5.2 application and when trying to run bin/webpack-dev-server
I get the following error:
✖ 「wds」: 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:
function | object { <key>: non-empty string | [non-empty string] } | non-empty string | [non-empty string]
-> The entry point(s) of the compilation.
Details:
* configuration.entry should be an instance of function
-> A Function returning an entry object, an entry string, an entry array or a promise to these things.
* configuration.entry should not be empty.
-> 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.
-> An entry point without name. The string is resolved to a module which is loaded upon startup.
* configuration.entry should be an array:
[non-empty string]
The key should be in configuration.entry should be one of these: function | object
but don't exactly know what this means...
The issue was that when I installed webpacker (rails webpacker:install
), I apparently already had an empty app/javascript
folder so the installation skipped those installation files:
The JavaScript app source directory already exists
Manually adding the app/javascript/packs/application.js
file fixed the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With