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

Error: Invalid "instanceof" keyword #1384

Closed
1 of 2 tasks
faisaljanjua opened this issue Apr 20, 2018 · 5 comments
Closed
1 of 2 tasks

Error: Invalid "instanceof" keyword #1384

faisaljanjua opened this issue Apr 20, 2018 · 5 comments

Comments

@faisaljanjua
Copy link

faisaljanjua commented Apr 20, 2018

  • Operating System:
  • Node Version: 9.11.1
  • NPM Version: 5.6.0
  • webpack Version: 3.4.1
  • webpack-dev-server Version: 3.1.3
  • This is a bug
  • This is a modification request

D:\boiler\bs-wp\node_modules\webpack\node_modules\ajv-keywords\keywords\instanceof.js:52
    throw new Error('invalid "instanceof" keyword value
' + c);
    ^

Error: invalid "instanceof" keyword value Promise
    at getConstructor (D:\boiler\bs-wp\node_modules\webpack\node_modules\ajv-keywords\keywords\instanceof.js:52:11)
    at Ajv.compile (D:\boiler\bs-wp\node_modules\webpack\node_modules\ajv-keywords\keywords\instanceof.js:21:27)    at Object.useCustomRule (D:\boiler\bs-wp\node_modules\webpack\node_modules\ajv\lib\compile\index.js:275:26)
    at Object.generate_custom [as code] (D:\boiler\bs-wp\node_modules\webpack\node_modules\ajv\lib\dotjs\custom.js:32:24)
    at Object.generate_validate [as validate] (D:\boiler\bs-wp\node_modules\webpack\node_modules\ajv\lib\dotjs\validate.js:347:35)
    at Object.generate_anyOf [as code] (D:\boiler\bs-wp\node_modules\webpack\node_modules\ajv\lib\dotjs\anyOf.js:34:27)
    at generate_validate (D:\boiler\bs-wp\node_modules\webpack\node_modules\ajv\lib\dotjs\validate.js:347:35)
    at localCompile (D:\boiler\bs-wp\node_modules\webpack\node_modules\ajv\lib\compile\index.js:87:22)
    at Ajv.compile (D:\boiler\bs-wp\node_modules\webpack\node_modules\ajv\lib\compile\index.js:56:13)
    at Ajv._compile (D:\boiler\bs-wp\node_modules\webpack\node_modules\ajv\lib\ajv.js:358:27)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bs-wp@1.0.0 start: `webpack-dev-server --open`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bs-wp@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There
is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Dell\AppData\Roaming\npm-cache\_logs\2018-04-20T13_26_09_341Z-debug.log

const path = require('path');

const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const CleanPlugin = require('clean-webpack-plugin');
const webpack = require('webpack');

module.exports = {
    entry: './src/app.js',
    devtool: 'inline-source-map',
    devServer: {
        contentBase: './dist',
        hot: true
    },
    module: {
        rules: [
            {
                test: /\.scss$/,
                use: ExtractTextPlugin.extract({
                    fallback: 'style-loader',
                    use: ['css-loader', 'sass-loader']
                })
            }
        ]
    },
    plugins: [
        new CleanPlugin(['dist']),
        new HtmlWebpackPlugin({
            title: 'Regenerating HTML',
            template: './src/index.ejs'
        }),
        new ExtractTextPlugin({
            filename: 'app.bundle.css',
            disable: false,
            allChunks: true
        })
    ],
    output: {
        filename: 'app.bundle.js',
        path: path.resolve(__dirname, 'dist')
    },
}
  // additional code, remove if not needed.

Expected Behavior

Dev Server

Actual Behavior

For Bugs; How can we reproduce the behavior?

For Features; What is the motivation and/or use-case for the feature?

@SpaceK33z
Copy link
Member

Please try to upgrade to the latest webpack and webpack-cli versions.

@faisaljanjua
Copy link
Author

strange, I was using the latest version then downgrade the webpack version, it was not working, now I again upgrade it, now have new error "Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint"
capture

@alexander-akait
Copy link
Member

alexander-akait commented May 29, 2018

Please update you deps, also you can install webpack or webpack-dev-server globally, please update their too and also please double check your lock file (if you use). Thanks!

@mzalazar
Copy link

After updating webpack, webpack-cli and webpack-dev-server... error is gone! =)

@rollinmendez000
Copy link

Getting error like this when running webpack in typescript project

invalid "instanceof" keyword value Promise

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

5 participants