Closed rteshnizi closed 5 years ago
/cc @tabrindle
This might've been fixed as part of https://github.com/facebook/create-react-app/pull/5685, but I'm not sure.
I don't think it's fixed. I can reproduce this exact error with envinfo 5.11.1
and 5.12.1
and this snippet.
const envinfo = require("envinfo");
return envinfo
.run(
{
System: ["OS", "CPU"],
Binaries: ["Node", "npm", "Yarn"],
Browsers: ["Chrome", "Edge", "Internet Explorer", "Firefox", "Safari"],
npmPackages: ["react", "react-dom", "react-scripts"],
npmGlobalPackages: ["create-react-app"]
},
{
clipboard: true,
duplicates: true,
showNotFound: true
}
)
.then(console.log);
That's taken from createReactApp.js. Part of the issue is that the code returns a promise and doesn't handle rejection at all, but envinfo is definitely failing. The error doesn't tell much, and the code is bundled so debugging is hard. Through trial and error I found that commenting out the clipboard option fixes it.
I tried working on envinfo, but I couldn't get it to build. It looks like src/envinfo.js
works and dist/envinfo.js
doesn't, so the problem probably crops up from bundling.
Actually I think this is just tabrindle/envinfo#57, which was closed but never resolved.
Hey all sorry for the delay. Based on a lot of usage feedback and compatibility problems I will be removing the bundled clipboard option from envinfo (it uses native binaries that aren't bundled with webpack), and i'll be making PRs to replace the functionality with the standalone package previously bundled in envinfo.
That PR just removed the clipboard option entirely - do you still want this functionality? It's not difficult to integrate - seems silly to remove instead of keeping the function the same.
Have you updated envinfo to fix the copy to clipboard functionality? We can always add it back.
The change to envinfo is simply a deprecation of the option, and will eventually be removed completely. I was simply going to extract the clipboard function to its local usage rather than core envinfo.
I'm not sure I follow. Are you saying you've deprecated the clipboard
option in envinfo and that we'd have to add this functionality using another package?
Seems like you do follow - sorry if I'm doing a poor job of english today.
Clipboardy caused some headache when building envinfo because of the native binaries it depends on. envinfo is mostly used via npx, and thus is bundled and compressed using webpack. On my mac the clipboard option works, but it seems on windows the lack of the extra binary breaks it.
Here's my PR: https://github.com/facebook/create-react-app/pull/5911
Is this a bug report?
Yes
Environment
See issue title.
node v8.11.1
npm v6.4.1
Steps to Reproduce
npx create-react-app --info
Expected Behavior
Show environment information. I have tried with different PCs.
Actual Behavior