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

[Bug] webpack-plugin 7.0.0 does not work with webpack 4 #2817

Closed
2 tasks done
ValeraS opened this issue Dec 11, 2021 · 8 comments · Fixed by #2818
Closed
2 tasks done

[Bug] webpack-plugin 7.0.0 does not work with webpack 4 #2817

ValeraS opened this issue Dec 11, 2021 · 8 comments · Fixed by #2818
Labels
bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@ValeraS
Copy link
Contributor

ValeraS commented Dec 11, 2021

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Code

No response

Actual Behavior

error:

ERROR in ./node_modules/monaco-editor/esm/vs/editor/editor.main.js
Module build failed (from ./node_modules/monaco-editor-webpack-plugin/out/loaders/include.js):
TypeError: this.getOptions is not a function
    at Object.pitch (./node_modules/monaco-editor-webpack-plugin/out/loaders/include.js:5:63)

In webpack 4, loaderContext does not have getOptions and utils.

Expected Behavior

works with webpack 4

Additional Context

No response

@hediet
Copy link
Member

hediet commented Dec 13, 2021

Thanks for reaching out and your PR!
Has this always been a problem with the webpack plugin or is this a regression?
Can you try out older versions?

@hediet hediet added the feature-request Request for new features or functionality label Dec 13, 2021
@ValeraS
Copy link
Contributor Author

ValeraS commented Dec 13, 2021

it is a regression. Versions 6 and bellow work with webpack 4.

@hediet
Copy link
Member

hediet commented Dec 13, 2021

Last month, all dependencies were updated in ed1ee25, probably that broke it.

When it worked before, why are the additions to the types of loader-utils now required?

@ValeraS
Copy link
Contributor Author

ValeraS commented Dec 13, 2021

Before that, loader-utils was loaded via require and had any type

const loaderUtils = require('loader-utils');

and now via import.

@isublimity
Copy link

+1, have problem webpack 4

@alexdima alexdima added this to the December 2021 milestone Dec 14, 2021
@alexdima alexdima added bug Issue identified by VS Code Team member as probable bug and removed feature-request Request for new features or functionality labels Dec 14, 2021
@alexdima alexdima modified the milestones: December 2021, January 2022 Dec 14, 2021
@lmcsu
Copy link

lmcsu commented Dec 16, 2021

Not working anyway.

 ERROR  Failed to compile with 1 error                                                                                                                                            7:06:54 PM

 error  in ./node_modules/monaco-editor/esm/vs/language/typescript/ts.worker.js

Module parse failed: Unexpected token (160333:49)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|       return [];
|     }
>     const preferences = this._inlayHintsOptions ?? {};
|     const span = {
|       start,

@ValeraS
Copy link
Contributor Author

ValeraS commented Dec 16, 2021

Not working anyway.

To fix this error, you can include the path . / Node_modules / monaco-editor / esm / vs / language into your js rule with appropriate loaders.

@perryhong
Copy link

Not working anyway.

To fix this error, you can include the path . / Node_modules / monaco-editor / esm / vs / language into your js rule with appropriate loaders.
what loaders how can i use?

@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants