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

Invalid Arg Type Error on minify #71

Closed
Chris2011 opened this issue Aug 31, 2021 · 11 comments · Fixed by #72
Closed

Invalid Arg Type Error on minify #71

Chris2011 opened this issue Aug 31, 2021 · 11 comments · Fixed by #72
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Chris2011
Copy link

I installed version 6.0.0 from html-minifier-terser. In the CLI I tried -> html-minifier-terser index.html --output index.min.html and I got this error:

C:\temp>html-minifier-terser index.html --output index.min.html
internal/streams/writable.js:285
      throw new ERR_INVALID_ARG_TYPE(
      ^

TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Promise
←[90m    at WriteStream.Writable.write (internal/streams/writable.js:285:13)←[39m
    at writeMinify (C:\Users\Chris\AppData\Roaming\npm\node_modules\←[4mhtml-minifier-terser←[24m\cli.js:288:24)
    at Object.<anonymous> (C:\Users\Chris\AppData\Roaming\npm\node_modules\←[4mhtml-minifier-terser←[24m\cli.js:305:3)
←[90m    at Module._compile (internal/modules/cjs/loader.js:1063:30)←[39m
←[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)←[39m
←[90m    at Module.load (internal/modules/cjs/loader.js:928:32)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:769:14)←[39m
←[90m    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)←[39m
←[90m    at internal/main/run_main_module.js:17:47←[39m {
  code: ←[32m'ERR_INVALID_ARG_TYPE'←[39m
}

Did I miss smth or did the syntax for the CLI changed?

Windows 10 (64bit)
Node: 14.16.0
NPM: 7.5.2

@DanielRuf
Copy link
Contributor

v6.0.0 uses aync / await. See also the readme regarding the usage.

Not sure if we have to change something in the CLI. PRs are very welcome.

@DanielRuf
Copy link
Contributor

@sibiraj-s can you check this?

@Chris2011
Copy link
Author

I use the same arguments/syntax as with version 5.1.1. Will check the readme again.

@DanielRuf
Copy link
Contributor

Not sure if we have to change something in the CLI.

@Chris2011 it's probably due to the changes in #63
No error on your side.

@Chris2011
Copy link
Author

Ok, thx for the info.

@sibiraj-s
Copy link
Collaborator

@sibiraj-s can you check this?

Sure

@sibiraj-s sibiraj-s mentioned this issue Sep 1, 2021
DanielRuf added a commit that referenced this issue Sep 1, 2021
@Chris2011
Copy link
Author

Thx for the fast fix, just want to know when the new version will be ready.

@DanielRuf
Copy link
Contributor

@Chris2011 v6.0.1 is now published on npmjs.

@Chris2011
Copy link
Author

Great thx :)

@laurentpayot
Copy link
Contributor

I had to open #74 for a similar issue on v6.0.1

@Chris2011
Copy link
Author

After using 6.0.2 everything works as before. Thx :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants