Issue with nightly RPMs and source maps

While trying to build an updated foreman nightly I get an error:

ERROR in /usr/lib/node_modules/patternfly-react/dist/sass/_breadcrumb.scss
Module build failed: ModuleBuildError: Module build failed: Error: "/usr/lib/node_modules/patternfly-react/dist/sass/_breadcrumb.scss" is not in the SourceMap.
    at SourceMapConsumer_sourceContentFor [as sourceContentFor] (/usr/lib/node_modules/css-loader/node_modules/postcss/node_modules/source-map/lib/source-map-consumer.js:704:13)
    at SourceMapGenerator.<anonymous> (/usr/lib/node_modules/css-loader/node_modules/postcss/node_modules/source-map/lib/source-map-generator.js:235:40)
    at Array.forEach (native)
    at SourceMapGenerator_applySourceMap [as applySourceMap] (/usr/lib/node_modules/css-loader/node_modules/postcss/node_modules/source-map/lib/source-map-generator.js:234:32)
    at MapGenerator.applyPrevMaps (/usr/lib/node_modules/css-loader/node_modules/postcss/lib/map-generator.js:146:22)
    at MapGenerator.generateMap (/usr/lib/node_modules/css-loader/node_modules/postcss/lib/map-generator.js:194:46)
    at MapGenerator.generate (/usr/lib/node_modules/css-loader/node_modules/postcss/lib/map-generator.js:296:25)
    at LazyResult.stringify (/usr/lib/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:306:24)
    at /usr/lib/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:243:27
    at runLoaders (/usr/lib/node_modules/webpack/lib/NormalModule.js:194:19)
    at /usr/lib/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:364:11
    at /usr/lib/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:230:18
    at context.callback (/usr/lib/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at Object.<anonymous> (/usr/lib/node_modules/css-loader/lib/loader.js:32:18)
    at /usr/lib/node_modules/css-loader/lib/processCss.js:211:3
 @ ./webpack/assets/javascripts/react_app/components/Breadcrumb/index.js 13:0-54
 @ ./webpack/assets/javascripts/react_app/components/componentRegistry.js
 @ ./webpack/assets/javascripts/react_app/common/MountingService.js
 @ ./webpack/assets/javascripts/bundle.js

See for the full log

I’m a bit at a loss how to fix this, but I’m wondering why we generate source maps at all. For my understanding that’s a development feature that shouldn’t be needed in production.

Any advice on how to proceed would be very welcome.

Paging @ui_ux team - please take a look.

Merged and now nightlies are green, so I guess this thread is over :slight_smile: good job @ekohl

Any idea why this stopped working? Did we upgrade the the patternfly
version as required by the breadcrumbs PR? I’m in mixed feelings about the
solution as having source maps on production can help debugging production

We did upgrade the patternfly and patternfly-react versions to those mentioned in the gemfiles and package.json. Not sure if that’s when the problem started to surface or when the breadcrumbs PR was merged.

Note that these are the source maps for scss. We have no source maps for css which also uses the css-loader. There’s also sourceMap: false in the UglifyJsPlugin config when we’re running in production mode. Just having source maps for scss is IMHO not that useful. If you think this is useful thing for production envs (and I do see your point) I’d open a redmine issue to generate source maps for all our webpack assets.