You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't use whois when using webpack because of the shebang at the beginning of the compiled whois/index.js file.
I get the following error:
Entrypoint worker = worker.bundle.js
[0] ./src/worker.ts 116 bytes {0} [built]
+ 1 hidden module
ERROR in ./node_modules/whois/index.js 1:0
Module parse failed: Unexpected character '#' (1:0)
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
> #!/usr/bin/env node
|
| // Generated by CoffeeScript 2.5.1
@ ./src/worker.ts 3:12-28
The solution would be to remove the shebang from index.js and create a separate entry point, bin.js, which has the shebang and would be used for the CLI. See this commit to see how another library with a similar problem, JSONStream, did it: dominictarr/JSONStream@debb492
Temporary workaround
A short-term workaround for our purposes was to install string-replace-loader and then add the following within our webpack config rules key:
Problem
I can't use whois when using webpack because of the shebang at the beginning of the compiled whois/index.js file.
I get the following error:
This is a similar issue to webpack/webpack#2168
Solution
The solution would be to remove the shebang from index.js and create a separate entry point, bin.js, which has the shebang and would be used for the CLI. See this commit to see how another library with a similar problem, JSONStream, did it: dominictarr/JSONStream@debb492
Temporary workaround
A short-term workaround for our purposes was to install
string-replace-loader
and then add the following within our webpack configrules
key:The text was updated successfully, but these errors were encountered: