Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devServer colors property not allowed when validating webpack.config.js #123

Open
donnrri opened this issue Aug 1, 2016 · 10 comments
Open

Comments

@donnrri
Copy link

donnrri commented Aug 1, 2016

Hi

Including devServer{
contentBase:"./public",
historyApiFallback: true,
inline: true
colors: true
}
When the colors property is included, I get the error 'colors is not allowed' . Is this correct ? I thought the colors property was valid. Thanks

@kentcdodds
Copy link
Collaborator

I think you're right. Do you see a difference in the webpack output when you include colors? Can you find a link to documentation or webpack code that utilizes the colors property?

@donnrri
Copy link
Author

donnrri commented Aug 1, 2016

Hi

Thanks for the quick response. Yes when I do not validate and have 'colors' I see warnings in yellow .
At the bottom of this page, colors is amoung the possible options https://webpack.github.io/docs/webpack-dev-server.html

Thanks for your time

@kentcdodds
Copy link
Collaborator

Looks like we need to add it to this and add a test here. Would you be willing to makeapullrequest.com?

@donnrri
Copy link
Author

donnrri commented Aug 1, 2016

Sure , that would be great. I'll do it tomorrow.

@donnrri
Copy link
Author

donnrri commented Aug 1, 2016

I'll go through your eggheadio course first!

@donnrri
Copy link
Author

donnrri commented Aug 2, 2016

Hello Kent,

Just to let you know , had some issues with npm install for
webpack-validator on Windows 10 using Node V4.4.6 . Any help would be
appreciated.

First ,I kept getting an error installing node-pre-gyp.

Error:
node-pre-gyp ERR! Tried to download:
https://node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v46-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for node-zopfli@1.4.0 and
node@4.4.6 (node-v46 ABI) (falling back to source compile with node-gyp)

Googling suggested either removing compression-webpack-plugin or installing
python ( I chose the former option) and npm install worked OK.

Next I ran npm run validate
I needed to install npm-run-all, eslint and nyc (npm packages) to solve
some errors.

But I'm getting an error from lodash 'cannot find module
lodash/lang/cloneDeep' which is odd as lodash is installed correctly. If
you have any ideas how to fix that I'd be grateful.

Two other points , perhaps I should do a PR to update the contribution.md
to alert contributors to the npm packeges (nyc, eslint etc) I found I
required (?). Also do you and other contributors use Macs (I got the
impression my initial issue was a Windows related problem).

Sorry I cannot go any further today with this, but hope to get the PR done
tomorrow.

Regards and thanks for such a useful tool.

On Mon, Aug 1, 2016 at 4:59 PM, Kent C. Dodds notifications@github.com
wrote:

Looks like we need to add it to this
https://github.com/js-dxtools/webpack-validator/blob/f055505ac09f11323ca8dd250808d32809f4e4be/src/properties/devServer/index.js
and add a test here
https://github.com/js-dxtools/webpack-validator/blob/f055505ac09f11323ca8dd250808d32809f4e4be/src/properties/devServer/index.test.js.
Would you be willing to makeapullrequest.com?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#123 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB3IM18g62cBkLuT7VsbwdSMFTu9wrW-ks5qbhf3gaJpZM4JZh0u
.

@kentcdodds
Copy link
Collaborator

Hey @donnrri,
Sorry you've been having trouble with this. I'm not certain what your problems are, but you shouldn't have to install extra packages. Running npm install in the project should give you everything you need. I'm guessing the reason you needed to install those other packages explicitly is because your original npm install failed. Could you try removing your node_modules folder and then running npm install again.

Also, what version of npm are you on? I recommend you get on the latest version 3.

@donnrri
Copy link
Author

donnrri commented Aug 2, 2016

Hi Kent,

OK will re-install. Im on npm V2.14.2 - will upgrade and see if that
works. Thanks for the email.

On Tue, Aug 2, 2016 at 3:46 PM, Kent C. Dodds notifications@github.com
wrote:

Hey @donnrri https://github.com/donnrri,
Sorry you've been having trouble with this. I'm not certain what your
problems are, but you shouldn't have to install extra packages. Running npm
install in the project should give you everything you need. I'm guessing
the reason you needed to install those other packages explicitly is because
your original npm install failed. Could you try removing your node_modules
folder and then running npm install again.

Also, what version of npm are you on? I recommend you get on the latest
version 3.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#123 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB3IMzz7qbFiQ84Wm_TFTNYTQRG1I5rxks5qb1gpgaJpZM4JZh0u
.

@nyrosmith
Copy link
Collaborator

nyrosmith commented Aug 10, 2016

npm run validate will fail on windows until this is fixed

@achadha
Copy link

achadha commented Nov 29, 2016

In case anyone else is seeing this issue, I've noticed that the "colors" attribute should be in the "stats" object.

devServer: {
        stats: {
            colors: true
        },
        contentBase: path.join({PATHNAME})
    }

This is slightly confusing, because you can use the --colors argument when running the CLI, and the documentation implies that these attributes can be included in the devServer object directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants