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

Compatibility with style-loader@1.0.0 #1945

Closed
Reinmar opened this issue Aug 8, 2019 · 4 comments · Fixed by #1949
Closed

Compatibility with style-loader@1.0.0 #1945

Reinmar opened this issue Aug 8, 2019 · 4 comments · Fixed by #1949
Assignees
Labels
type:docs This issue reports a task related to documentation (e.g. an idea for a guide). type:task This issue reports a chore (non-production change) and other types of "todos".
Milestone

Comments

@Reinmar
Copy link
Member

Reinmar commented Aug 8, 2019

When you're following our quick start guide, where we explain to install style-loader from npm, you end up with this error:

ERROR in ./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css
Module build failed (from ./node_modules/style-loader/dist/index.js):
ValidationError: Invalid options object. Style Loader has been initialised using an options object that does not match the API schema.
 - options has an unknown property 'singleton'. These properties are valid:
   object { injectType?, attributes?, insert?, base? }
    at validate (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\node_modules\schema-utils\dist\validate.js:49:11)
    at Object.loader (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\dist\index.js:17:28)
 @ ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js 15:0-36
 @ ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js
 @ ./app.js
ERROR in ./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css
Module build failed (from ./node_modules/style-loader/dist/index.js):
ValidationError: Invalid options object. Style Loader has been initialised using an options object that does not match the API schema.
 - options has an unknown property 'singleton'. These properties are valid:
   object { injectType?, attributes?, insert?, base? }
    at validate (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\node_modules\schema-utils\dist\validate.js:49:11)
    at Object.loader (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\dist\index.js:17:28)
 @ ./node_modules/@ckeditor/ckeditor5-engine/src/view/placeholder.js 10:0-37
 @ ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditorui.js
 @ ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js
 @ ./app.js
ERROR in ./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css
Module build failed (from ./node_modules/style-loader/dist/index.js):
ValidationError: Invalid options object. Style Loader has been initialised using an options object that does not match the API schema.
 - options has an unknown property 'singleton'. These properties are valid:
   object { injectType?, attributes?, insert?, base? }
    at validate (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\node_modules\schema-utils\dist\validate.js:49:11)
    at Object.loader (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\dist\index.js:17:28)
 @ ./node_modules/@ckeditor/ckeditor5-ui/src/panel/sticky/stickypanelview.js 15:0-57
 @ ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js
 @ ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js
 @ ./app.js
ERROR in ./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css
Module build failed (from ./node_modules/style-loader/dist/index.js):
ValidationError: Invalid options object. Style Loader has been initialised using an options object that does not match the API schema.
 - options has an unknown property 'singleton'. These properties are valid:
   object { injectType?, attributes?, insert?, base? }
    at validate (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\node_modules\schema-utils\dist\validate.js:49:11)
    at Object.loader (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\dist\index.js:17:28)
 @ ./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js 17:0-50
 @ ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js
 @ ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js
 @ ./app.js
ERROR in ./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css
Module build failed (from ./node_modules/style-loader/dist/index.js):
ValidationError: Invalid options object. Style Loader has been initialised using an options object that does not match the API schema.
 - options has an unknown property 'singleton'. These properties are valid:
   object { injectType?, attributes?, insert?, base? }
    at validate (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\node_modules\schema-utils\dist\validate.js:49:11)
    at Object.loader (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\dist\index.js:17:28)
 @ ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js 18:0-52
 @ ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js
 @ ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js
 @ ./app.js
ERROR in ./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css
Module build failed (from ./node_modules/style-loader/dist/index.js):
ValidationError: Invalid options object. Style Loader has been initialised using an options object that does not match the API schema.
 - options has an unknown property 'singleton'. These properties are valid:
   object { injectType?, attributes?, insert?, base? }
    at validate (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\node_modules\schema-utils\dist\validate.js:49:11)
    at Object.loader (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\dist\index.js:17:28)
 @ ./node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js 15:0-54
 @ ./node_modules/@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview.js
 @ ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js
 @ ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js
 @ ./app.js
ERROR in ./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css
Module build failed (from ./node_modules/style-loader/dist/index.js):
ValidationError: Invalid options object. Style Loader has been initialised using an options object that does not match the API schema.
 - options has an unknown property 'singleton'. These properties are valid:
   object { injectType?, attributes?, insert?, base? }
    at validate (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\node_modules\schema-utils\dist\validate.js:49:11)
    at Object.loader (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\dist\index.js:17:28)
 @ ./node_modules/@ckeditor/ckeditor5-ui/src/view.js 19:0-38
 @ ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js
 @ ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js
 @ ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js
 @ ./app.js
ERROR in ./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css
Module build failed (from ./node_modules/style-loader/dist/index.js):
ValidationError: Invalid options object. Style Loader has been initialised using an options object that does not match the API schema.
 - options has an unknown property 'singleton'. These properties are valid:
   object { injectType?, attributes?, insert?, base? }
    at validate (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\node_modules\schema-utils\dist\validate.js:49:11)
    at Object.loader (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\dist\index.js:17:28)
 @ ./node_modules/@ckeditor/ckeditor5-ui/src/tooltip/tooltipview.js 12:0-52
 @ ./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js
 @ ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js
 @ ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js
 @ ./app.js
ERROR in ./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css
Module build failed (from ./node_modules/style-loader/dist/index.js):
ValidationError: Invalid options object. Style Loader has been initialised using an options object that does not match the API schema.
 - options has an unknown property 'singleton'. These properties are valid:
   object { injectType?, attributes?, insert?, base? }
    at validate (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\node_modules\schema-utils\dist\validate.js:49:11)
    at Object.loader (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\dist\index.js:17:28)
 @ ./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js 14:0-46
 @ ./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js
 @ ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js
 @ ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js
 @ ./app.js
ERROR in ./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css
Module build failed (from ./node_modules/style-loader/dist/index.js):
ValidationError: Invalid options object. Style Loader has been initialised using an options object that does not match the API schema.
 - options has an unknown property 'singleton'. These properties are valid:
   object { injectType?, attributes?, insert?, base? }
    at validate (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\node_modules\schema-utils\dist\validate.js:49:11)
    at Object.loader (C:\Users\mgswo\Git\cke5-source\node_modules\style-loader\dist\index.js:17:28)
 @ ./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js 12:0-48
 @ ./node_modules/@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview.js
 @ ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js
 @ ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js
 @ ./app.js
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Collapse

Apparently, the new version of style-loader (so far, we've been using 0.23.0) changed something in its configuration. We've got to look into that. For now, I'll make a PR to add a version specifier to npm i call.

@Reinmar Reinmar added status:confirmed type:docs This issue reports a task related to documentation (e.g. an idea for a guide). type:task This issue reports a chore (non-production change) and other types of "todos". labels Aug 8, 2019
@Reinmar Reinmar added this to the iteration 26 milestone Aug 8, 2019
@ma2ciek
Copy link
Contributor

ma2ciek commented Aug 8, 2019

I see that the API has changed significantly - https://github.com/webpack-contrib/style-loader/releases/tag/v1.0.0.

@Reinmar
Copy link
Member Author

Reinmar commented Aug 8, 2019

We use only the singleton option, so this applies to us:

the singleton option was removed (look documentation about the injectType option)

@oleq
Copy link
Member

oleq commented Aug 8, 2019

I created PRs in ckeditor5, ckeditor5-build-* and ckeditor5-dev that migrate the entire project to style-loader v1.0.0. Root PR.

@arthurcantarela
Copy link

arthurcantarela commented Aug 13, 2019

It seems to work replacing singleton: true with injectType: "singletonStyleTag" in the style-loader options object, as seen in https://github.com/webpack-contrib/style-loader#injecttype

Reinmar added a commit to ckeditor/ckeditor5-dev that referenced this issue Aug 14, 2019
Other: Bumped style-loader to v1.0.0. Aligned the webpack config to the new loader API. See ckeditor/ckeditor5#1945.
Reinmar added a commit that referenced this issue Aug 14, 2019
Other: Bumped style-loader to v1.0.0. Aligned configurations and documentation to the new loader API. Closes #1945.
Reinmar added a commit to ckeditor/ckeditor5-build-classic that referenced this issue Aug 14, 2019
Other: Bumped style-loader to v1.0.0. Aligned the webpack config to the new loader API. See ckeditor/ckeditor5#1945.
Reinmar added a commit to ckeditor/ckeditor5-build-balloon that referenced this issue Aug 14, 2019
Other: Bumped style-loader to v1.0.0. Aligned the webpack config to the new loader API. See ckeditor/ckeditor5#1945.
Reinmar added a commit to ckeditor/ckeditor5-build-balloon-block that referenced this issue Aug 14, 2019
Other: Bumped style-loader to v1.0.0. Aligned the webpack config to the new loader API. See ckeditor/ckeditor5#1945.
Reinmar added a commit to ckeditor/ckeditor5-build-decoupled-document that referenced this issue Aug 14, 2019
Other: Bumped style-loader to v1.0.0. Aligned the webpack config to the new loader API. See ckeditor/ckeditor5#1945.
Reinmar added a commit to ckeditor/ckeditor5-build-inline that referenced this issue Aug 14, 2019
Other: Bumped style-loader to v1.0.0. Aligned the webpack config to the new loader API. See ckeditor/ckeditor5#1945.
JDinABox pushed a commit to JDinABox/ckeditor5-build-markdown that referenced this issue Sep 6, 2021
Other: Bumped style-loader to v1.0.0. Aligned the webpack config to the new loader API. See ckeditor/ckeditor5#1945.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:docs This issue reports a task related to documentation (e.g. an idea for a guide). type:task This issue reports a chore (non-production change) and other types of "todos".
Projects
None yet
4 participants