-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
Invalid options object. HTML Loader #357
Comments
I think I found the cause of this error. Below is the diff of diff --git a/src/options.json b/src/options.json
index 70ae501..d4ce35d 100644
--- a/src/options.json
+++ b/src/options.json
@@ -1,27 +1,65 @@
{
"type": "object",
+ "definitions": {
+ "Attribute": {
+ "type": "object",
+ "properties": {
+ "tag": {
+ "type": "string",
+ "minLength": 1
+ },
+ "attribute": {
+ "type": "string",
+ "minLength": 1
+ },
+ "type": {
+ "enum": ["src", "srcset"]
+ },
+ "filter": {
+ "instanceof": "Function"
+ }
+ },
+ "required": ["tag", "attribute", "type"],
+ "additionalProperties": false
+ },
+ "AttributeList": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Attribute"
+ },
+ "minItems": 1,
+ "uniqueItems": true
+ }
+ },
"properties": {
- "url": {
- "anyOf": [
- { "type": "string" },
- { "type": "boolean" },
- { "instanceof": "RegExp" },
- { "instanceof": "Function" }
- ]
+ "preprocessor": {
+ "instanceof": "Function"
},
- "import": {
+ "attributes": {
"anyOf": [
- { "type": "string" },
{ "type": "boolean" },
- { "instanceof": "RegExp" },
- { "instanceof": "Function" }
+ {
+ "type": "object",
+ "properties": {
+ "list": {
+ "$ref": "#/definitions/AttributeList"
+ },
+ "urlFilter": {
+ "instanceof": "Function"
+ },
+ "root": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
]
},
- "template": {
- "type": [ "boolean", "string" ]
- },
"minimize": {
- "type": [ "boolean", "object" ]
+ "anyOf": [{ "type": "boolean" }, { "type": "object" }]
+ },
+ "esModule": {
+ "type": "boolean"
}
},
"additionalProperties": false
You can see that
|
I can confirm this! Some days ago the electron-webpack-quick-start was working as expected. I got it working by fixing the html-loader
This should work as a workaround for all that are stumbling over this issue until electron-webpack adapts to the changes made in html-loader version 1.0.0. |
Cool. |
@phloose this worked for us thank you |
Alternatively for yarn you can add a module resolution. e.g.
note: js-yaml was included to remove a severe vulnerability in that package which is required by html-loader < 1.0.0. Once we can use the latest version of html-loader then that won't be an issue either. |
Great reporting everyone, thanks a lot! |
Hello developers.
I'm trying to run electron-webpack as dev, on my
package.json
has a script"dev": "electron-webpack dev"
, But when it initing to build dev, the process broken and follow error is outputted:My setup is very simple, I don't add plugin or customs webpack files.
My directory structure:
package.json:
main / index.js
Are empty.
view / index.js
Are empty.
electron-webpack.json
I downloaded the "electron-webpack-quick-start" for test here link, but it has the same error.
output error (full):
The text was updated successfully, but these errors were encountered: