framework7 icon indicating copy to clipboard operation
framework7 copied to clipboard

Error start with yarn dev

Open EloFran opened this issue 6 years ago • 5 comments

Describe the bug

Error in new installation with yarn dev

To Reproduce

yarn dev

PS E:\aaa-oposiciones> yarn dev     
yarn run v1.22.5
$ cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.config.js
E:\aaa-oposiciones\node_modules\schema-utils\dist\validate.js:104
    throw new _ValidationError.default(errors, schema, configuration);
    ^

ValidationError: Invalid options object. Terser Plugin has been initialized using an options object that does 
not match the API schema.
 - options has an unknown property 'sourceMap'. These properties are valid:
   object { test?, include?, exclude?, parallel?, minify?, terserOptions?, extractComments? }
    at validate (E:\aaa-oposiciones\node_modules\schema-utils\dist\validate.js:104:11)
    at new TerserPlugin (E:\aaa-oposiciones\node_modules\terser-webpack-plugin\dist\index.js:32:31)
    at Object.<anonymous> (E:\aaa-oposiciones\build\webpack.config.js:55:17)
    at Module._compile (internal/modules/cjs/loader.js:1015:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
    at Module.load (internal/modules/cjs/loader.js:879:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:903:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at WEBPACK_OPTIONS (E:\aaa-oposiciones\node_modules\webpack-cli\bin\utils\convert-argv.js:114:13)
    at requireConfig (E:\aaa-oposiciones\node_modules\webpack-cli\bin\utils\convert-argv.js:116:6)
    at E:\aaa-oposiciones\node_modules\webpack-cli\bin\utils\convert-argv.js:123:17
    at Array.forEach (<anonymous>)
    at module.exports (E:\aaa-oposiciones\node_modules\webpack-cli\bin\utils\convert-argv.js:121:15)
    at Object.<anonymous> (E:\aaa-oposiciones\node_modules\webpack-dev-server\bin\webpack-dev-server.js:84:40)    at Module._compile (internal/modules/cjs/loader.js:1015:30) {
  errors: [
    {
      keyword: 'additionalProperties',
      dataPath: '',
      schemaPath: '#/additionalProperties',
      params: { additionalProperty: 'sourceMap' },
      message: 'should NOT have additional properties',
      schema: false,
      parentSchema: {
        definitions: {
          Rule: {
            description: 'Filtering rule as regex or string.',
            anyOf: [Array]
          },
          Rules: { description: 'Filtering rules.', anyOf: [Array] }
        },
        title: 'TerserPluginOptions',
        type: 'object',
        additionalProperties: false,
        properties: {
          test: {
            description: 'Include all modules that pass test assertion.',
            oneOf: [Array]
          },
          include: {
            description: 'Include all modules matching any of these conditions.',
            oneOf: [Array]
          },
          exclude: {
            description: 'Exclude all modules matching any of these conditions.',
            oneOf: [Array]
          },
          parallel: {
            description: 'Use multi-process parallel running to improve the build speed.',
            anyOf: [Array]
          },
          minify: {
            description: 'Allows you to override default minify function.',
            instanceof: 'Function'
          },
          terserOptions: {
            description: 'Options for `terser`.',
            additionalProperties: true,
            type: 'object'
          },
          extractComments: {
            description: 'Whether comments shall be extracted to a separate file.',
            anyOf: [Array]
          }
        }
      },
      data: { sourceMap: true }
    }
  ],
  schema: {
    definitions: {
      Rule: {
        description: 'Filtering rule as regex or string.',
        anyOf: [
          { instanceof: 'RegExp', tsType: 'RegExp' },
          { type: 'string', minLength: 1 }
        ]
      },
      Rules: {
        description: 'Filtering rules.',
        anyOf: [
          { type: 'array', items: [Object] },
          { '$ref': '#/definitions/Rule' }
        ]
      }
    },
    title: 'TerserPluginOptions',
    type: 'object',
    additionalProperties: false,
    properties: {
      test: {
        description: 'Include all modules that pass test assertion.',
        oneOf: [ { '$ref': '#/definitions/Rules' } ]
      },
      include: {
        description: 'Include all modules matching any of these conditions.',
        oneOf: [ { '$ref': '#/definitions/Rules' } ]
      },
      exclude: {
        description: 'Exclude all modules matching any of these conditions.',
        oneOf: [ { '$ref': '#/definitions/Rules' } ]
      },
      parallel: {
        description: 'Use multi-process parallel running to improve the build speed.',
        anyOf: [ { type: 'boolean' }, { type: 'integer' } ]
      },
      minify: {
        description: 'Allows you to override default minify function.',
        instanceof: 'Function'
      },
      terserOptions: {
        description: 'Options for `terser`.',
        additionalProperties: true,
        type: 'object'
      },
      extractComments: {
        description: 'Whether comments shall be extracted to a separate file.',
        anyOf: [
          { type: 'boolean' },
          { type: 'string' },
          { instanceof: 'RegExp' },
          { instanceof: 'Function' },
          {
            additionalProperties: false,
            properties: [Object],
            type: 'object'
          }
        ]
      }
    }
  },
  headerName: 'Terser Plugin',
  baseDataPath: 'options',
  postFormatter: null
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Expected behavior

Start in dev mode

Actual Behavior

Error and no start return code 1

EloFran avatar Oct 16 '20 16:10 EloFran

i have same isue with npm run start

Wenangsani avatar Oct 17 '20 03:10 Wenangsani

This might be related to https://github.com/framework7io/framework7-cli/issues/99

lependu avatar Oct 17 '20 09:10 lependu

ok, correct, it works, whit me, using these webpack versions in package.json

"webpack": "^4.44.2",
    "webpack-cli": "3.3.12",
    "webpack-dev-server": "^3.11.0",
    "workbox-webpack-plugin": "^5.1.4"

EloFran avatar Oct 17 '20 17:10 EloFran

Had to change "terser-webpack-plugin": "^5.1.0" to "terser-webpack-plugin": "^4.2.3"

yeshansachithak avatar Oct 19 '20 05:10 yeshansachithak

Same as https://github.com/framework7io/framework7-cli/issues/99

nolimits4web avatar Oct 19 '20 09:10 nolimits4web