Bug #16599

"SyntaxError: Unexpected identifier" webpack build error in svgo package

Added by Dominic Cleal 11 months ago. Updated 11 months ago.

Status:Closed
Priority:High
Assigned To:Tomer Brisker
Category:Packaging
Target version:Team Daniel - iteration 3
Difficulty: Bugzilla link:
Found in release: Pull request:https://github.com/theforeman/foreman/pull/3885, https://github.com/theforeman/foreman-packaging/pull/1355, https://github.com/theforeman/foreman/pull/3861
Story points-
Velocity based estimate-
Release1.13.0Release relationshipAuto

Description

test_develop and PR builds are failing to run on NodeJS 0.10.46 (on Jenkins) with the following error:

/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/.bin/webpack --config /var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/config/webpack.config.js --bail
The Apipie cache is turned off. Enable it and run apipie:cache rake task to speed up API calls.

/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/css-loader/node_modules/cssnano/node_modules/postcss-svgo/node_modules/svgo/plugins/cleanupIDs.js:123
    for (var ID of referencesIDs) {
                ^^
ModuleBuildError: Module build failed: ModuleBuildError: Module build failed: SyntaxError: Unexpected identifier
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at /var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/css-loader/node_modules/cssnano/node_modules/postcss-svgo/node_modules/svgo/lib/svgo/config.js:99:33
    at Array.map (native)
    at preparePluginsArray (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/css-loader/node_modules/cssnano/node_modules/postcss-svgo/node_modules/svgo/lib/svgo/config.js:64:20)
    at module.exports (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/css-loader/node_modules/cssnano/node_modules/postcss-svgo/node_modules/svgo/lib/svgo/config.js:32:28)
    at new module.exports (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/css-loader/node_modules/cssnano/node_modules/postcss-svgo/node_modules/svgo/lib/svgo.js:21:19)
    at /var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/css-loader/node_modules/cssnano/node_modules/postcss-svgo/dist/index.js:91:16
    at Object.creator [as postcssSvgo] (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/css-loader/node_modules/postcss/lib/postcss.js:150:35)
    at /var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/css-loader/node_modules/cssnano/dist/index.js:276:40
    at Array.forEach (native)
    at /var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/css-loader/node_modules/cssnano/dist/index.js:263:29
    at creator (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/css-loader/node_modules/postcss/lib/postcss.js:150:35)
    at processCss (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/css-loader/lib/processCss.js:185:16)
    at Object.module.exports (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/css-loader/lib/loader.js:24:2)
    at DependenciesBlock.onModuleBuildFailed (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:315:19)
    at nextLoader (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:270:31)
    at /var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:292:15
    at runSyncOrAsync (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:173:4)
    at nextLoader (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:290:3)
    at /var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:259:5
    at Storage.finished (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:38:16)
    at /var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/enhanced-resolve/node_modules/graceful-fs/graceful-fs.js:78:16
    at fs.js:272:14
    at /var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/enhanced-resolve/node_modules/graceful-fs/graceful-fs.js:43:10
    at Object.oncomplete (fs.js:108:15)
    at DependenciesBlock.onModuleBuildFailed (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:315:19)
    at DependenciesBlock.<anonymous> (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:228:39)
    at context.callback (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:148:14)
    at Object.<anonymous> (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/extract-text-webpack-plugin/loader.js:82:20)
    at Compiler.<anonymous> (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/lib/Compiler.js:204:18)
    at Compiler.<anonymous> (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/lib/Compiler.js:395:18)
    at /var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/tapable/lib/Tapable.js:99:11
    at Compilation.<anonymous> (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/lib/Compilation.js:433:11)
    at errorAndCallback (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/lib/Compilation.js:340:3)
    at Compilation.<anonymous> (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/lib/Compilation.js:400:12)
    at /var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/lib/Compilation.js:123:4
    at Array.forEach (native)
    at callback (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/lib/Compilation.js:122:12)
    at Compilation.<anonymous> (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/lib/Compilation.js:137:11)
    at DependenciesBlock.<anonymous> (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/lib/NormalModule.js:85:18)
    at DependenciesBlock.onModuleBuildFailed (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:315:10)
    at nextLoader (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:270:31)
    at /var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:292:15
    at runSyncOrAsync (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:173:4)
    at nextLoader (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:290:3)
    at /var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:259:5
    at Storage.finished (/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:38:16)
    at /var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/enhanced-resolve/node_modules/graceful-fs/graceful-fs.js:78:16
    at fs.js:272:14
    at /var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.3/slave/fast/node_modules/webpack/node_modules/enhanced-resolve/node_modules/graceful-fs/graceful-fs.js:43:10
    at Object.oncomplete (fs.js:108:15)
rm -rf jenkins/reports/unit/
WARNING: `rake webpack:compile` failed to run. This is only important if running integration tests. (cause: Command failed with status (1): [/var/lib/workspace/workspace/test_develop/...])

Associated revisions

Revision deb5e338
Added by Dominic Cleal 11 months ago

refs #16599 - update npm to latest release

Required to read a partial shrinkwrap file.

Revision f7ccfcc5
Added by Tomer Brisker 11 months ago

Fixes #16599 - Shrinkwrap npm modules

This is a temporary workaround to pin a few modules that break when
using node 0.10 until we can require a newer node version.

History

#1 Updated by Dominic Cleal 11 months ago

The svgo package's engine dependency was increased to >= 0.12.0 when adding this ES2015 syntax, so it's likely that Foreman's min engine version should match or it needs pinning. This is not the only module however that claims incompatibility with 0.10.0:

npm WARN engine eslint@3.5.0: wanted: {"node":">=4"} (current: {"node":"v0.10.46","npm":"1.3.6"})
npm WARN engine jest-cli@15.1.1: wanted: {"node":">= 4"} (current: {"node":"v0.10.46","npm":"1.3.6"})
npm WARN engine postcss@5.2.0: wanted: {"node":">=0.12"} (current: {"node":"v0.10.46","npm":"1.3.6"})
npm WARN engine callsites@2.0.0: wanted: {"node":">=4"} (current: {"node":"v0.10.46","npm":"1.3.6"})
npm WARN engine svgo@0.7.0: wanted: {"node":">=0.12.0"} (current: {"node":"v0.10.46","npm":"1.3.6"})
npm WARN engine vendors@1.0.1: wanted: {"node":">=0.11.0"} (current: {"node":"v0.10.46","npm":"1.3.6"})
npm WARN engine escodegen@1.8.1: wanted: {"node":">=0.12.0"} (current: {"node":"v0.10.46","npm":"1.3.6"})
npm WARN engine escodegen@1.8.1: wanted: {"node":">=0.12.0"} (current: {"node":"v0.10.46","npm":"1.3.6"})
npm WARN engine strip-bom@3.0.0: wanted: {"node":">=4"} (current: {"node":"v0.10.46","npm":"1.3.6"})
npm WARN engine form-data@2.0.0: wanted: {"node":">= 0.12"} (current: {"node":"v0.10.46","npm":"1.3.6"})
npm WARN engine http-signature@1.1.1: wanted: {"node":">=0.8","npm":">=1.3.7"} (current: {"node":"v0.10.46","npm":"1.3.6"})
npm WARN engine co@4.6.0: wanted: {"iojs":">= 1.0.0","node":">= 0.12.0"} (current: {"node":"v0.10.46","npm":"1.3.6"})

#2 Updated by Ketan Ghotekar 11 months ago

Dominic Cleal wrote:

The svgo package's engine dependency was increased to >= 0.12.0 when adding this ES2015 syntax, so it's likely that Foreman's min engine version should match or it needs pinning. This is not the only module however that claims incompatibility with 0.10.0:

[...]

Can you please tell me how this issue was resolved. Did you update any packages? I am facing the exact same issue. Please help.

#3 Updated by The Foreman Bot 11 months ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Tomer Brisker
  • Pull request https://github.com/theforeman/foreman/pull/3861 added

#4 Updated by Daniel Lobato Garcia 11 months ago

  • Target version set to Team Daniel - iteration 3

#5 Updated by The Foreman Bot 11 months ago

  • Pull request https://github.com/theforeman/foreman-packaging/pull/1355 added

#6 Updated by Anonymous 11 months ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#7 Updated by The Foreman Bot 11 months ago

  • Pull request https://github.com/theforeman/foreman/pull/3885 added

Also available in: Atom PDF