momocow / webpack-userscript

A Webpack plugin for userscript projects. 🙈
https://cow.moe/webpack-userscript/
MIT License
200 stars 21 forks source link

The headers validate feature is missing some valid values. #87

Closed yingziwu closed 1 year ago

yingziwu commented 1 year ago

The headers validate feature is missing some valid values and cause build failed!

Project: https://github.com/404-novel-project/novel-downloader/tree/webpack-userscript

$ yarn build
development: false
commit count: 821
version: 5.1.821
[webpack-cli] HookWebpackError: An instance of Headers has failed the validation:
 - property name:en has failed the following constraints: whitelistValidation 

An instance of Headers has failed the validation:
 - property name:ja has failed the following constraints: whitelistValidation 

An instance of Headers has failed the validation:
 - property description:en has failed the following constraints: whitelistValidation 

An instance of Headers has failed the validation:
 - property description:ja has failed the following constraints: whitelistValidation 

An instance of Headers has failed the validation:
 - property license has failed the following constraints: whitelistValidation 

An instance of Headers has failed the validation:
 - property compatible has failed the following constraints: whitelistValidation 

An instance of Headers has failed the validation:
 - property incompatible has failed the following constraints: whitelistValidation 

    at makeWebpackError (/srv/app/404-novel-project/novel-downloader/node_modules/webpack/lib/HookWebpackError.js:48:9)
    at /srv/app/404-novel-project/novel-downloader/node_modules/webpack/lib/Compilation.js:3060:12
    at eval (eval at create (/srv/app/404-novel-project/novel-downloader/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:34:1)
-- inner error --
Error: An instance of Headers has failed the validation:
 - property name:en has failed the following constraints: whitelistValidation 

An instance of Headers has failed the validation:
 - property name:ja has failed the following constraints: whitelistValidation 

An instance of Headers has failed the validation:
 - property description:en has failed the following constraints: whitelistValidation 

An instance of Headers has failed the validation:
 - property description:ja has failed the following constraints: whitelistValidation 

An instance of Headers has failed the validation:
 - property license has failed the following constraints: whitelistValidation 

An instance of Headers has failed the validation:
 - property compatible has failed the following constraints: whitelistValidation 

An instance of Headers has failed the validation:
 - property incompatible has failed the following constraints: whitelistValidation 

    at ValidateHeaders.validateHeaders (/srv/app/404-novel-project/novel-downloader/node_modules/webpack-userscript/dist/features/validate-headers/impl.js:33:23)
    at /srv/app/404-novel-project/novel-downloader/node_modules/webpack-userscript/dist/features/validate-headers/impl.js:16:61
    at _next3 (eval at create (/srv/app/404-novel-project/novel-downloader/node_modules/webpack-userscript/node_modules/tapable/lib/HookCodeFactory.js:75:10), <anonymous>:42:16)
    at eval (eval at create (/srv/app/404-novel-project/novel-downloader/node_modules/webpack-userscript/node_modules/tapable/lib/HookCodeFactory.js:75:10), <anonymous>:91:1)
caused by plugins in Compilation.hooks.processAssets
Error: An instance of Headers has failed the validation:
 - property name:en has failed the following constraints: whitelistValidation 

An instance of Headers has failed the validation:
 - property name:ja has failed the following constraints: whitelistValidation 

An instance of Headers has failed the validation:
 - property description:en has failed the following constraints: whitelistValidation 

An instance of Headers has failed the validation:
 - property description:ja has failed the following constraints: whitelistValidation 

An instance of Headers has failed the validation:
 - property license has failed the following constraints: whitelistValidation 

An instance of Headers has failed the validation:
 - property compatible has failed the following constraints: whitelistValidation 

An instance of Headers has failed the validation:
 - property incompatible has failed the following constraints: whitelistValidation 

    at ValidateHeaders.validateHeaders (/srv/app/404-novel-project/novel-downloader/node_modules/webpack-userscript/dist/features/validate-headers/impl.js:33:23)
    at /srv/app/404-novel-project/novel-downloader/node_modules/webpack-userscript/dist/features/validate-headers/impl.js:16:61
    at _next3 (eval at create (/srv/app/404-novel-project/novel-downloader/node_modules/webpack-userscript/node_modules/tapable/lib/HookCodeFactory.js:75:10), <anonymous>:42:16)
    at eval (eval at create (/srv/app/404-novel-project/novel-downloader/node_modules/webpack-userscript/node_modules/tapable/lib/HookCodeFactory.js:75:10), <anonymous>:91:1)  

Version

webpack: 5.76.1 webpack-userscript: 3.1.0

Additional

https://github.com/momocow/webpack-userscript/blob/3bc5d5cf85f6208a09b31ec01966c9199c328d2f/lib/features/validate-headers/headers.ts#L22-L171

Some references:

Some missing values:

momocow commented 1 year ago

Wow, such a nice list of missing values! Thank you!

ilyhalight commented 1 year ago

Wow, such a nice list of missing values! Thank you!

Any news on the release date of the update with these changes?

momocow commented 1 year ago

@ilyhalight 3 days maybe.

Some tags have already been added in the dev branch; however, I'm currently dealing with the localized tags like @name:XX-YY introduced by Greasy Fork.

inazuma-bot commented 1 year ago

:tada: This issue has been resolved in version 3.2.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: