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

aliases.yaml YAMLException #194

Open
incorporated777 opened this issue Jul 5, 2021 · 16 comments
Open

aliases.yaml YAMLException #194

incorporated777 opened this issue Jul 5, 2021 · 16 comments

Comments

@incorporated777
Copy link

After upgrading to newest 4.0.0 version when trying to start grunt tasks I get error:

$ grunt
Loading "gruntFile.js" tasks...ERROR
>> YAMLException: Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })
Warning: Task "default" not found. Use --force to continue.

With one of the defined tasks:

$ grunt dev
Loading "gruntFile.js" tasks...ERROR
>> YAMLException: Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })
Warning: Task "dev" not found. Use --force to continue.

After downgrading to version 3.0.2 everything is running smooth.

Node version: 10.16.0

aliases.yaml definition

default:
  - 'newer:less'
  - 'newer:babel'
  - 'webpack:prod'
  - 'watch'

dev:
  - 'newer:babel'
  - 'webpack:prod'
  - 'concurrent:dev'
@incorporated777
Copy link
Author

Is anyone here? :|

incorporated777 referenced this issue Aug 9, 2021
 - dropped support of CoffeeScript
 - removed package-lock.json file
@SolomoN-ua
Copy link
Collaborator

Hi @incorporated777,

I can't reproduce this issue,, could you please provide more details or better a test that will help to reproduce it?
also could you please check what js-yaml and js-yaml-js-types versions you have in your node_modules after installation of the dependencies?

@mbrodala
Copy link

I can confirm the issue when trying to upgrade from 3.0.0 to 4.0.0:

$ grunt -vvv
Initializing
Command-line options: --verbose, --gruntfile=/.../Gruntfile.js

Reading "Gruntfile.js" Gruntfile...OK

Registering Gruntfile tasks.
Loading "Gruntfile.js" tasks...ERROR
>> YAMLException: Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })
>>     at Schema.extend (/.../node_modules/load-grunt-config/node_modules/js-yaml/lib/schema.js:84:11)
>>     at module.exports (/.../node_modules/load-grunt-config/lib/readfile.js:17:42)
>>     at /.../node_modules/load-grunt-config/lib/readconfigdir.js:21:18
>>     at Array.forEach (<anonymous>:null:null)
>>     at module.exports (/.../node_modules/load-grunt-config/lib/readconfigdir.js:19:9)
>>     at /.../node_modules/load-grunt-config/lib/gruntconfig.js:10:28
>>     at arrayReduce (/.../node_modules/lodash/lodash.js:697:21)
>>     at Function.reduce (/.../node_modules/lodash/lodash.js:9749:14)
>>     at LodashWrapper.object.<computed> [as reduce] (/.../node_modules/lodash/lodash.js:15806:25)
>>     at module.exports (/.../node_modules/load-grunt-config/lib/gruntconfig.js:9:6)
>>     at module.exports (/.../node_modules/load-grunt-config/index.js:33:16)
>>     at Object.module.exports (/.../Gruntfile.js:4:31)
>>     at loadTask (/.../node_modules/grunt/lib/grunt/task.js:315:10)
>>     at Task.task.init (/.../node_modules/grunt/lib/grunt/task.js:450:5)
>>     at Object.grunt.tasks (/.../node_modules/grunt/lib/grunt.js:129:8)
>>     at Liftoff.<anonymous> (/usr/lib/node_modules/grunt-cli/bin/grunt:68:15)
>>     at Liftoff.execute (/usr/lib/node_modules/grunt-cli/node_modules/liftup/index.js:202:12)
>>     at module.exports (/usr/lib/node_modules/grunt-cli/node_modules/flagged-respawn/index.js:51:3)
>>     at Liftoff.<anonymous> (/usr/lib/node_modules/grunt-cli/node_modules/liftup/index.js:192:5)
>>     at Liftoff.<anonymous> (/usr/lib/node_modules/grunt-cli/node_modules/liftup/index.js:155:7)
>>     at processTicksAndRejections (internal/process/task_queues.js:79:11)

No tasks specified, running default tasks.
Running tasks: default
Warning: Task "default" not found. Use --force to continue.

Aborted due to warnings.

The Gruntfile.js:

module.exports = function(grunt) {
  var path = require('path');

  require('load-grunt-config')(grunt, {
    configPath: [
      path.join(process.cwd(), 'config', 'grunt'),
    ],
  });
};

And config/grunt/aliases.yaml:

default:
  - clean
  - less
  - copy
  - npmcopy
  - uglify

@mbrodala
Copy link

Notice that e.g. aliases.json seems to work just fine so this could be used in the meantime.

@mbrodala
Copy link

mbrodala commented Aug 20, 2021

@SolomoN-ua As for your questions:

js-yaml (4.1.0)
$ yarn info js-yaml 
yarn info v1.22.5
{
  name: 'js-yaml',
  description: 'YAML 1.2 parser and serializer',
  'dist-tags': {
    latest: '4.1.0'
  },
  versions: [
    '0.2.0',
    '0.2.1',
    '0.2.2',
    '0.3.0',
    '0.3.1',
    '0.3.2',
    '0.3.3',
    '0.3.4',
    '0.3.5',
    '0.3.6',
    '0.3.7',
    '1.0.0',
    '1.0.1',
    '1.0.2',
    '1.0.3',
    '2.0.0',
    '2.0.1',
    '2.0.2',
    '2.0.3',
    '2.0.4',
    '2.0.5',
    '2.1.0',
    '2.1.1',
    '2.1.2',
    '2.1.3',
    '3.0.0',
    '3.0.1',
    '3.0.2',
    '3.1.0',
    '3.2.1',
    '3.2.2',
    '3.2.3',
    '3.2.4',
    '3.2.5',
    '3.2.6',
    '3.2.7',
    '3.3.0',
    '3.3.1',
    '3.4.0',
    '3.4.1',
    '3.4.2',
    '3.4.3',
    '3.4.4',
    '3.4.5',
    '3.4.6',
    '3.5.0',
    '3.5.1',
    '3.5.2',
    '3.5.3',
    '3.5.4',
    '3.5.5',
    '3.6.0',
    '3.6.1',
    '3.7.0',
    '3.8.0',
    '3.8.1',
    '3.8.2',
    '3.8.3',
    '3.8.4',
    '3.9.0',
    '3.9.1',
    '3.10.0',
    '3.11.0',
    '3.12.0',
    '3.12.1',
    '3.12.2',
    '3.13.0',
    '3.13.1',
    '3.14.0',
    '3.14.1',
    '4.0.0',
    '4.1.0'
  ],
  maintainers: [
    {
      name: 'vitaly',
      email: 'vitaly@rcdesign.ru'
    }
  ],
  time: {
    modified: '2021-04-14T21:07:11.250Z',
    created: '2011-11-02T01:56:02.870Z',
    '0.2.0': '2011-11-02T01:56:04.988Z',
    '0.2.1': '2011-11-02T15:44:59.476Z',
    '0.2.2': '2011-11-06T19:36:46.376Z',
    '0.3.0': '2011-11-09T11:50:52.572Z',
    '0.3.1': '2011-11-18T04:40:26.297Z',
    '0.3.2': '2011-12-16T03:11:23.796Z',
    '0.3.3': '2011-12-20T00:33:34.021Z',
    '0.3.4': '2011-12-24T12:11:57.618Z',
    '0.3.5': '2012-01-10T12:03:28.241Z',
    '0.3.6': '2012-02-22T04:58:30.034Z',
    '0.3.7': '2012-02-28T16:06:34.722Z',
    '1.0.0': '2012-07-01T15:02:00.004Z',
    '1.0.1': '2012-07-07T09:42:56.820Z',
    '1.0.2': '2012-08-02T08:44:43.484Z',
    '1.0.3': '2012-11-05T01:57:23.010Z',
    '2.0.0': '2013-02-09T07:34:25.954Z',
    '2.0.1': '2013-02-09T15:41:35.905Z',
    '2.0.2': '2013-02-15T11:22:57.482Z',
    '2.0.3': '2013-02-26T03:14:59.871Z',
    '2.0.4': '2013-04-08T11:45:36.838Z',
    '2.0.5': '2013-04-26T14:40:59.621Z',
    '2.1.0': '2013-06-05T14:44:09.636Z',
    '2.1.1': '2013-10-01T20:08:34.063Z',
    '2.1.2': '2013-10-06T21:35:32.358Z',
    '2.1.3': '2013-10-15T21:30:17.137Z',
    '3.0.0': '2013-12-16T08:35:24.383Z',
    '3.0.1': '2013-12-22T18:44:21.114Z',
    '3.0.2': '2014-02-27T03:20:28.502Z',
    '3.1.0': '2014-07-07T09:31:00.559Z',
    '3.2.0': '2014-08-24T07:50:32.612Z',
    '3.2.1': '2014-08-24T08:05:01.740Z',
    '3.2.2': '2014-09-06T20:33:29.831Z',
    '3.2.3': '2014-11-08T05:12:03.094Z',
    '3.2.4': '2014-12-19T13:13:57.457Z',
    '3.2.5': '2014-12-27T22:20:55.637Z',
    '3.2.6': '2015-02-07T03:02:33.322Z',
    '3.2.7': '2015-02-19T10:09:14.968Z',
    '3.3.0': '2015-04-26T05:56:35.340Z',
    '3.3.1': '2015-05-13T13:37:54.734Z',
    '3.4.0': '2015-08-22T22:35:19.729Z',
    '3.4.1': '2015-09-04T23:36:30.962Z',
    '3.4.2': '2015-09-09T10:06:07.503Z',
    '3.4.3': '2015-10-10T19:41:24.397Z',
    '3.4.4': '2015-11-21T20:20:51.107Z',
    '3.4.5': '2015-11-23T04:26:14.849Z',
    '3.4.6': '2015-11-26T13:53:40.452Z',
    '3.5.0': '2016-01-10T19:09:01.309Z',
    '3.5.1': '2016-01-11T01:28:37.047Z',
    '3.5.2': '2016-01-11T11:03:18.527Z',
    '3.5.3': '2016-02-11T07:27:27.075Z',
    '3.5.4': '2016-03-09T18:25:33.192Z',
    '3.5.5': '2016-03-17T14:48:49.376Z',
    '3.6.0': '2016-04-15T21:18:53.001Z',
    '3.6.1': '2016-05-11T19:40:39.230Z',
    '3.7.0': '2016-11-12T01:32:04.258Z',
    '3.8.0': '2017-02-07T00:31:34.951Z',
    '3.8.1': '2017-02-07T00:39:35.390Z',
    '3.8.2': '2017-03-02T16:49:42.243Z',
    '3.8.3': '2017-04-05T12:47:42.580Z',
    '3.8.4': '2017-05-08T15:16:29.219Z',
    '3.9.0': '2017-07-08T08:50:56.677Z',
    '3.9.1': '2017-07-30T07:33:59.643Z',
    '3.10.0': '2017-09-11T08:19:12.765Z',
    '3.11.0': '2018-03-05T15:52:52.361Z',
    '3.12.0': '2018-06-01T22:48:26.432Z',
    '3.12.1': '2019-01-05T09:22:04.437Z',
    '3.12.2': '2019-02-26T15:03:08.027Z',
    '3.13.0': '2019-03-20T19:16:31.897Z',
    '3.13.1': '2019-04-05T16:15:22.531Z',
    '3.14.0': '2020-05-22T18:30:32.680Z',
    '3.14.1': '2020-12-07T19:45:10.828Z',
    '4.0.0': '2021-01-03T13:51:18.695Z',
    '4.1.0': '2021-04-14T21:07:09.057Z'
  },
  author: {
    name: 'Vladimir Zapparov',
    email: 'dervus.grim@gmail.com'
  },
  repository: {
    type: 'git',
    url: 'git+https://github.com/nodeca/js-yaml.git'
  },
  users: {
    pvorb: true,
    matthiasg: true,
    fgribreau: true,
    sbruchmann: true,
    adamrenny: true,
    brianloveswords: true,
    asilvas: true,
    gabeio: true,
    goliatone: true,
    lewisbrown: true,
    japh: true,
    'alxe.master': true,
    'dewang-mistry': true,
    alvint: true,
    brentonhouse: true,
    jelhaouchi: true,
    jdhartley: true,
    itonyyo: true,
    loki2302: true,
    buzuli: true,
    gerst20051: true,
    rdcl: true,
    brentlintner: true,
    denji: true,
    rdesoky: true,
    willpracht: true,
    paroczi: true,
    eviratec: true,
    lvivier: true,
    smartcoordination: true,
    fdeneux: true,
    monsterkodi: true,
    evan2x: true,
    octetstream: true,
    mfellner: true,
    bjmin: true,
    leodutra: true,
    ambdxtrch: true,
    ajmckee: true,
    coalesce: true,
    pstoev: true,
    illuminator: true,
    shanewholloway: true,
    wouter_vdb: true,
    nigel0913: true,
    fleischer: true,
    monjer: true,
    nukosuke: true,
    captison: true,
    cknowles: true,
    talltotal: true,
    leizongmin: true,
    akarem: true,
    mikestaub: true,
    jakedetels: true,
    hifaraz: true,
    bensonho: true,
    ajduke: true,
    tteogi: true,
    tmurngon: true,
    gabriellopes: true,
    penglu: true,
    troygizzi: true,
    gbas: true,
    prometheas: true,
    iori20091101: true,
    skellertor: true,
    rickyrattlesnake: true,
    program247365: true,
    leonzhao: true,
    janez89: true,
    tcrowe: true,
    bsara: true,
    kael: true,
    holmes89: true,
    quafoo: true,
    lacodda: true,
    crimeminister: true,
    stone_breaker: true,
    nikolay: true,
    kontrax: true,
    stanlous: true,
    axelrindle: true,
    bphanikumar: true,
    lvpeng101: true,
    yitzchak: true,
    tsxuehu: true,
    lholmquist: true,
    felarof99: true,
    elevenlui: true,
    kakaman: true,
    lgh06: true,
    kekdude: true,
    edwardxyt: true,
    keenwon: true,
    d7game: true,
    geofftech: true,
    hehaiyang: true,
    rogeruiz: true,
    muwum: true,
    bstevenson: true,
    'zhenguo.zhao': true,
    omar84: true,
    nickeltobias: true,
    nilz3ro: true,
    jream: true,
    chrisyipw: true,
    nuwaio: true,
    sammade: true,
    tamikot: true,
    chronosis: true,
    eterna2: true,
    maxkoryukov: true,
    astraloverflow: true,
    nraibaud: true,
    onlyutkarsh: true,
    ierhyna: true,
    xgheaven: true,
    xiaobing: true,
    arcticicestudio: true,
    daizch: true
  },
  homepage: 'https://github.com/nodeca/js-yaml#readme',
  keywords: [
    'yaml',
    'parser',
    'serializer',
    'pyyaml'
  ],
  contributors: [
    {
      name: 'Aleksey V Zapparov',
      email: 'ixti@member.fsf.org',
      url: 'http://www.ixti.net/'
    },
    {
      name: 'Vitaly Puzrin',
      email: 'vitaly@rcdesign.ru',
      url: 'https://github.com/puzrin'
    },
    {
      name: 'Martin Grenfell',
      email: 'martin.grenfell@gmail.com',
      url: 'http://got-ravings.blogspot.com'
    }
  ],
  bugs: {
    url: 'https://github.com/nodeca/js-yaml/issues'
  },
  license: 'MIT',
  readmeFilename: 'README.md',
  version: '4.1.0',
  bin: {
    'js-yaml': 'bin/js-yaml.js'
  },
  module: './dist/js-yaml.mjs',
  exports: {
    '.': {
      import: './dist/js-yaml.mjs',
      require: './index.js'
    },
    './package.json': './package.json'
  },
  scripts: {
    lint: 'eslint .',
    test: 'npm run lint && mocha',
    coverage: 'npm run lint && nyc mocha && nyc report --reporter html',
    demo: 'npm run lint && node support/build_demo.js',
    'gh-demo': 'npm run demo && gh-pages -d demo -f',
    browserify: 'rollup -c support/rollup.config.js',
    prepublishOnly: 'npm run gh-demo'
  },
  unpkg: 'dist/js-yaml.min.js',
  jsdelivr: 'dist/js-yaml.min.js',
  dependencies: {
    argparse: '^2.0.1'
  },
  devDependencies: {
    '@rollup/plugin-commonjs': '^17.0.0',
    '@rollup/plugin-node-resolve': '^11.0.0',
    ansi: '^0.3.1',
    benchmark: '^2.1.4',
    codemirror: '^5.13.4',
    eslint: '^7.0.0',
    'fast-check': '^2.8.0',
    'gh-pages': '^3.1.0',
    mocha: '^8.2.1',
    nyc: '^15.1.0',
    rollup: '^2.34.1',
    'rollup-plugin-node-polyfills': '^0.2.1',
    'rollup-plugin-terser': '^7.0.2',
    shelljs: '^0.8.4'
  },
  gitHead: '2cef47bebf60da141b78b085f3dea3b5733dcc12',
  dist: {
    integrity: 'sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==',
    shasum: 'c1fb65f8f5017901cdd2c951864ba18458a10602',
    tarball: 'https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz',
    fileCount: 33,
    unpackedSize: 404738,
    'npm-signature': '-----BEGIN PGP SIGNATURE-----\r\n' +
      'Version: OpenPGP.js v3.0.13\r\n' +
      'Comment: https://openpgpjs.org\r\n' +
      '\r\n' +
      'wsFcBAEBCAAQBQJgd1l9CRA9TVsSAnZWagAAF9IP/2c294d40B2nns6UDAZ4\n' +
      'ylTFVx0ODEZ056pBsj5y2doSpU4mJmBdtwk0Ts5JPRyomu9rbqwmXccZqkio\n' +
      'MIpWs4ZBxvZZLtmBT7KgFxAHUZ/veI6zylIzM8l5WXNaTR0x7EoupTsw3ErJ\n' +
      'fcW9vpePbd2Dk1bApZCd3XANCF5DAyqqKzPHFJQwAfDib5j91T7q1Z+H0Ppj\n' +
      'fPNRKyd4MQPjTK9pWmWeKju02wG3jOqy05pBjHrFMUiVuCpdX98gfbw5+gNj\n' +
      'rUXT13EVKiNiQkE78wGENVhfUM/tfUDn7hU6Fovg7pVeh6sJdxUqu8aqChSZ\n' +
      'GPG6vzCDJrn524Tn7HlpnIeK3CFBrKAmgvlcH4nvEWHU2ZB6nUUjfJU/Ooke\n' +
      'cAdiQ8SDpcecRa0+7y15zxxIVLcbdhgyuBcel5AfMbeEPrLFshwtq1d9Dqc2\n' +
      'AdAPU3ZcLJ+pin1ppEdYavYBq/C+p3deW0tRf8sIgWCi22uP8xNrZrL2MyE7\n' +
      '+S7S7FDnyngk2hn7cdKZF7l2VSXHtPMkg4Cv4E2vWdb/JPR/QkgTOHs5Yavo\n' +
      'iAzX2Kgtp02XgEQcYtYQGejdm/DT+hdwBQVlNol7gh7C0PExo8Q5aQucGBxU\n' +
      's5N/5cK8afcSe+jpL4OpzFUTorve2TQPC/+7ZLXLmrKwEQ9aQnlfMXP2ZCTQ\n' +
      '7iqF\r\n' +
      '=1gZB\r\n' +
      '-----END PGP SIGNATURE-----\r\n'
  },
  directories: {}
}
js-yaml-js-types (1.0.0)
$ yarn info js-yaml-js-types
yarn info v1.22.5
{
  name: 'js-yaml-js-types',
  'dist-tags': {
    latest: '1.0.0'
  },
  versions: [
    '1.0.0'
  ],
  time: {
    created: '2021-01-04T10:54:51.796Z',
    '1.0.0': '2021-01-04T10:54:51.931Z',
    modified: '2021-01-04T10:54:54.287Z'
  },
  maintainers: [
    {
      name: 'vitaly',
      email: 'vitaly@rcdesign.ru'
    }
  ],
  description: 'js-yaml extra types',
  homepage: 'https://github.com/nodeca/js-yaml-js-types#readme',
  keywords: [
    'yaml',
    'parser'
  ],
  repository: {
    type: 'git',
    url: 'git+https://github.com/nodeca/js-yaml-js-types.git'
  },
  bugs: {
    url: 'https://github.com/nodeca/js-yaml-js-types/issues'
  },
  license: 'MIT',
  readmeFilename: 'README.md',
  version: '1.0.0',
  scripts: {
    lint: 'eslint .',
    test: 'npm run lint && mocha',
    coverage: 'npm run lint && nyc mocha && nyc report --reporter html'
  },
  devDependencies: {
    eslint: '^7.0.0',
    'js-yaml': '^4.0.0',
    mocha: '^7.1.2',
    nyc: '^15.1.0'
  },
  dependencies: {
    esprima: '^4.0.1'
  },
  gitHead: 'ac537e7bbdd3c2cbbd9882ca3919c520c2dc022b',
  dist: {
    integrity: 'sha512-UNjPwuoaj4mcHkJCJSF6l4MgkzoFjG+JJkBXMYNvjgO3yE9gTeRt+E6PN022vduz/daZZ7HmlEiSEE36NrGE4w==',
    shasum: 'bf17cb75c7587c698294d15bbfa5f9b8b10b874b',
    tarball: 'https://registry.npmjs.org/js-yaml-js-types/-/js-yaml-js-types-1.0.0.tgz',
    fileCount: 8,
    unpackedSize: 7340,
    'npm-signature': '-----BEGIN PGP SIGNATURE-----\r\n' +
      'Version: OpenPGP.js v3.0.13\r\n' +
      'Comment: https://openpgpjs.org\r\n' +
      '\r\n' +
      'wsFcBAEBCAAQBQJf8vP8CRA9TVsSAnZWagAAt/4P+wePgUyJY059mUGKLXX5\n' +
      '3UALA+bu6cMsrDH5Ld4gDN4ooFmxk5BMJKWAszBJvtJF25xGk/eJlI7rFl1k\n' +
      'hivFlg/HzCDkTvDKxaw2GVIhVn3C0XbfwbNZVTgCNbFb3BowRbVM53g9Yxqo\n' +
      'dduDKddgXNhwdcA98ijf+MtH0rwRltCejaBv2p2c4bBplTaqUXCsEn00FXc8\n' +
      'DJTq+daRKx2WKUbukI0Bj1g1w5doU0h5QFncY2c3himmsCwFXcd+apQj/r48\n' +
      'JDBT4gUeHk4GSwkIzpbZCtVBxD11PJuIxL3jfPPs0djNNAsXqtPmGL5uctaK\n' +
      'nI7Ydf1LTl2QkB2a5qr9ZVoFLLrt1qYpxZALee4Ba+kQ+5JMUOzlQumlGhxE\n' +
      'ls/MoMMro2qG08+2hQarGraIR1/rTtZdc/9bZH43qEEazEuWOObeYy0eDppR\n' +
      'TUpwM9eLM4GkFgGjLM8zJ4t9HN/5YG6S0+tVRcWcTvUdDo0F55e/exWqpxp7\n' +
      'L15bPVYB6d8MTlA7WE6o7rlkE+POE9lGEcV+M9dgT749Jdy/D4HTW2HPF25E\n' +
      'fRyx27KAQ5Js2+KW9AmGyhtByVOBWiziy5zE0OagiVNhpbW76vwVhInN4Azk\n' +
      'e9xRo1DLylN5R/dt3d55NWjO9QW8RgSKCVKwA3axnpAcFD748CMJ69HP17JS\n' +
      'xnEC\r\n' +
      '=SUvZ\r\n' +
      '-----END PGP SIGNATURE-----\r\n'
  },
  directories: {}
}
Done in 0.81s.

@SolomoN-ua
Copy link
Collaborator

@mbrodala thx for extra information, but as far as I remember yarn info does not show what version is currently installed and if it is installed at all. Issue described by you above looks like missing or incorrect js-yaml-js-types dependency. Could you please verify that is exists in your project node_modules folder?

@mbrodala
Copy link

mbrodala commented Aug 20, 2021

The filesystem agrees with Yarn:

$ grep version node_modules/js-yaml*/package.json
node_modules/js-yaml-js-types/package.json:  "version": "1.0.0",
node_modules/js-yaml/package.json:  "version": "3.14.1",

At least by existence. Indeed js-yaml is outdated on the disk. 🤔

@mbrodala
Copy link

Here are relevant entries from the yarn.lock:

js-yaml@4.1.0:
  version "4.1.0"
  resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
  integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
  dependencies:
    argparse "^2.0.1"

js-yaml@^3.1.0, js-yaml@~3.14.0:
  version "3.14.1"
  resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537"
  integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==
  dependencies:
    argparse "^1.0.7"
    esprima "^4.0.0"

js-yaml@~3.4.3:
  version "3.4.6"
  resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.4.6.tgz#6be1b23f6249f53d293370fd4d1aaa63ce1b4eb0"
  integrity sha1-a+GyP2JJ9T0pM3D9TRqqY84bTrA=
  dependencies:
    argparse "^1.0.2"
    esprima "^2.6.0"
    inherit "^2.2.2"

I never got behind the mess of multiple versions of the same package in the Node world. 🤷‍♂️

@SolomoN-ua
Copy link
Collaborator

@mbrodala thx for extra info, I just released "debug" version 4.0.1, could you please give it a try and if it will fail send here console output?

@mbrodala
Copy link

Here we go:

$ grunt -vvv
Initializing
Command-line options: --verbose, --gruntfile=/.../Gruntfile.js

Reading "Gruntfile.js" Gruntfile...OK

Registering Gruntfile tasks.
Invalid js-yaml extension type type: Type {
  tag: 'tag:yaml.org,2002:js/regexp',
  kind: 'scalar',
  resolve: [Function: resolveJavascriptRegExp],
  construct: [Function: constructJavascriptRegExp],
  instanceOf: null,
  predicate: [Function: isRegExp],
  represent: [Function: representJavascriptRegExp],
  defaultStyle: null,
  styleAliases: {}
}
Loading "Gruntfile.js" tasks...ERROR
>> YAMLException: Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })
>>     at Schema.extend (/.../node_modules/load-grunt-config/node_modules/js-yaml/lib/schema.js:84:11)
>>     at module.exports (/.../node_modules/load-grunt-config/lib/readfile.js:21:42)
>>     at /.../node_modules/load-grunt-config/lib/readconfigdir.js:21:18
>>     at Array.forEach (<anonymous>:null:null)
>>     at module.exports (/.../node_modules/load-grunt-config/lib/readconfigdir.js:19:9)
>>     at /.../node_modules/load-grunt-config/lib/gruntconfig.js:10:28
>>     at arrayReduce (/.../node_modules/lodash/lodash.js:697:21)
>>     at Function.reduce (/.../node_modules/lodash/lodash.js:9749:14)
>>     at LodashWrapper.object.<computed> [as reduce] (/.../node_modules/lodash/lodash.js:15806:25)
>>     at module.exports (/.../node_modules/load-grunt-config/lib/gruntconfig.js:9:6)
>>     at module.exports (/.../node_modules/load-grunt-config/index.js:33:16)
>>     at Object.module.exports (/.../Gruntfile.js:4:31)
>>     at loadTask (/.../node_modules/grunt/lib/grunt/task.js:315:10)
>>     at Task.task.init (/.../node_modules/grunt/lib/grunt/task.js:450:5)
>>     at Object.grunt.tasks (/.../node_modules/grunt/lib/grunt.js:129:8)
>>     at Liftoff.<anonymous> (/usr/lib/node_modules/grunt-cli/bin/grunt:68:15)
>>     at Liftoff.execute (/usr/lib/node_modules/grunt-cli/node_modules/liftup/index.js:202:12)
>>     at module.exports (/usr/lib/node_modules/grunt-cli/node_modules/flagged-respawn/index.js:51:3)
>>     at Liftoff.<anonymous> (/usr/lib/node_modules/grunt-cli/node_modules/liftup/index.js:192:5)
>>     at Liftoff.<anonymous> (/usr/lib/node_modules/grunt-cli/node_modules/liftup/index.js:155:7)
>>     at processTicksAndRejections (internal/process/task_queues.js:79:11)

No tasks specified, running default tasks.
Running tasks: default
Warning: Task "default" not found. Use --force to continue.

Aborted due to warnings.

@SolomoN-ua
Copy link
Collaborator

@mbrodala thanks, so looks like this is an issue with js-yaml will try to create a bug there because I think there is nothing that we can do on our side.

Btw, could you please provide some other details just in case if it will be needed for js-yaml project to investigate the issue?
Like: node --version and OS win/mac/linux?

@mbrodala
Copy link

No problem:

$ node --version
v12.22.1
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.2 LTS
Release:	20.04
Codename:	focal

OS is Linux in a Docker container, the host OS is also Linux though.

@SolomoN-ua
Copy link
Collaborator

@mbrodala thank you. I just created an issue for js-yaml. Lets wait for the answer there.

nodeca/js-yaml#637

@SolomoN-ua
Copy link
Collaborator

@mbrodala just as a workaround you can try to add js-yaml@4.1.0 as a dependency in your main package.json. That is just a crazy idea, but it can do the trick.

@mbrodala
Copy link

That works indeed. But using JSON instead of YAML is already a good workaround. ;-)

@fxbenard
Copy link

fxbenard commented Oct 2, 2021

Same issue here, solved it using a JSON file, thanks for the trick.

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