Discussion:
Bug#976310: [Pkg-javascript-devel] Bug#976310: node-compression-webpack-plugin: TypeError: (0 , _schemaUtils.validate) is not a function
(too old to reply)
Xavier
2020-12-03 09:20:02 UTC
Permalink
Control: tags -1 + moreinfo
Package: node-compression-webpack-plugin
Version: 3.0.1-3
Severity: serious
Control: affects -1 gitlab
Installation of gitlab started failing with the following error. I think
this is related to the recent update of node-schema-utils.
Webpacking...
/usr/share/nodejs/webpack/node_modules/webpack-cli/bin/cli.js:93
               throw err;
               ^
TypeError: (0 , _schemaUtils.validate) is not a function
Hi,
_schemaUtils.validate *is* a function when using schema-utils ≥ 3.
Problem is probably somewhere else
Does gitlab use `npm install` ? If so, we just have to fix
node-compression-webpack-plugin/package.json
Pirate Praveen
2020-12-03 21:10:02 UTC
Permalink
Control: reopen -1
Control: reassign -1 gitlab
Post by Xavier
Does gitlab use `npm install` ? If so, we just have to fix
node-compression-webpack-plugin/package.json
This is indeed caused by mix of schema-utils 2 and 3. Version 2 is
pulled by yarn and version 3 by debian.

I found a work around for now,

cd /usr/share/nodejs/compression-webpack-plugin/node_modules
ln -s /usr/share/nodejs/schema-utils/ .
cd /usr/share/nodejs/uglifyjs-webpack-plugin/node_modules
ln -s /usr/share/nodejs/schema-utils/ .
cd /usr/share/nodejs/webpack/node_modules
ln -s /usr/share/nodejs/schema-utils/ .
cd /usr/share/nodejs/cache-loader-loader/node_modules
ln -s /usr/share/nodejs/schema-utils/ .
mkdir /usr/share/nodejs/url-loader/node_modules
cd /usr/share/nodejs/url-loader/node_modules
ln -s /usr/share/nodejs/schema-utils/ .
mkdir /usr/share/nodejs/babel-loader/node_modules
cd /usr/share/nodejs/babel-loader/node_modules
ln -s /usr/share/nodejs/schema-utils/ .

I will try to get css-loader from debian working with gitlab as a
proper fix.
Pirate Praveen
2020-12-04 19:40:01 UTC
Permalink
Control: clone -1 -2
Control: reassign -2 node-css-loader
Control: retitle -2 many dependencies in the archive differ by major
versions
Post by Pirate Praveen
I will try to get css-loader from debian working with gitlab as a
proper fix.
With css-loader 3, the error is given at bottom,

I think some of the dependencies of node-css-loader 3 in the archive
are not matching major versions

"postcss-modules-extract-imports": "^2.0.0", vs
node-postcss-modules-extract-imports: 3.0.0-1
"postcss-modules-local-by-default": "^3.0.2", and 4.0.0 is embedded
"postcss-modules-scope": "^2.1.1", and 3.0 is embedded
"postcss-modules-values": "^3.0.0", vs node-postcss-modules-values
4.0
"postcss-value-parser": "^4.0.2", vs node-postcss-value-parser

ERROR in
/var/lib/gitlab/.node_modules/monaco-editor/esm/vs/base/browser/ui/menu/men
u.css
(/usr/share/nodejs/css-loader/dist/cjs.js??ref--9-1!/var/lib/gitlab/.node_modu
les/monaco-editor/esm/vs/base/browser/ui/menu/menu.css)
Module build failed (from /usr/share/nodejs/css-loader/dist/cjs.js):
Error: true is not a PostCSS plugin
at Processor.normalize
(/var/lib/gitlab/.node_modules/postcss/lib/processor.js:1
68:15)
at new Processor
(/var/lib/gitlab/.node_modules/postcss/lib/processor.js:52:25)
at postcss
(/var/lib/gitlab/.node_modules/postcss/lib/postcss.js:55:10)
at Object.loader (/usr/share/nodejs/css-loader/dist/index.js:84:24)
@
/var/lib/gitlab/.node_modules/monaco-editor/esm/vs/base/browser/ui/menu/menu.css
4:14-120
@
/var/lib/gitlab/.node_modules/monaco-editor/esm/vs/base/browser/ui/menu/menu.js
@
/var/lib/gitlab/.node_modules/monaco-editor/esm/vs/platform/contextview/browser/c
ontextMenuHandler.js
@
/var/lib/gitlab/.node_modules/monaco-editor/esm/vs/platform/contextview/browser/c
ontextMenuService.js
@
/var/lib/gitlab/.node_modules/monaco-editor/esm/vs/editor/standalone/browser/stan
daloneServices.js
@
/var/lib/gitlab/.node_modules/monaco-editor/esm/vs/editor/standalone/browser/stan
daloneEditor.js
@
/var/lib/gitlab/.node_modules/monaco-editor/esm/vs/editor/editor.api.js
@
include-loader!/var/lib/gitlab/.node_modules/monaco-editor/esm/vs/editor/editor.a
pi.js
@
/var/lib/gitlab/.node_modules/monaco-editor/esm/vs/language/typescript/monaco.con
tribution.js
@
include-loader!/var/lib/gitlab/.node_modules/monaco-editor/esm/vs/editor/editor.m
ain.js
@ ./editor/editor_lite.js
@ ./blob/utils.js
@ ./snippet/snippet_bundle.js
@ ./snippet/snippet_edit.js
@ ./pages/snippets/new/index.js
@ multi ./main ./pages/snippets/new/index.js
Pirate Praveen
2020-12-04 21:10:01 UTC
Permalink
Control: reopen -1
Control: tag -1 pending
Hello,
Bug #976310 in node-css-loader reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
https://salsa.debian.org/js-team/node-css-loader/-/commit/130e5ef8425bb78f300953766d003f32392cbd1d
------------------------------------------------------------------------
Fix schema-utils version in package.json
Closes: #976310
No, this does not fix the issue. The previous one did not either. Yarn
does not see this package.json at all.

See
https://salsa.debian.org/ruby-team/gitlab/-/blob/master/debian/patches/0740-use-packaged-modules.patch

Only the modules that are not packaged will be installed via yarn. This
was working fine till node-schema-utils/node-mkdirp updates.

With these updates, we can't mix packaged modules and yarn installed
modules. We have to use the work around I mentioned earlier add
node_modules/schema-utils link in all packaged modules or use packaged
versions of all modules that depend on schema-utils/mkdirp (another
possibility is to update the versions in package.json which uses newer
schema-utils/mkdirp which will need adapting gitlab itself).

Loading...