index.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. maybeWarn: try {
  2. var stackTraceLimit = Error.stackTraceLimit;
  3. Error.stackTraceLimit = Infinity;
  4. var stack = new Error().stack;
  5. Error.stackTraceLimit = stackTraceLimit;
  6. if (!stack.includes("babel-preset-react-app")) break maybeWarn;
  7. // Try this as a fallback, in case it's available in node_modules
  8. module.exports = require("@babel/plugin-transform-private-property-in-object");
  9. setTimeout(console.warn, 2500, `\
  10. \x1B[0;33mOne of your dependencies, babel-preset-react-app, is importing the
  11. "@babel/plugin-proposal-private-property-in-object" package without
  12. declaring it in its dependencies. This is currently working because
  13. "@babel/plugin-proposal-private-property-in-object" is already in your
  14. node_modules folder for unrelated reasons, but it \x1B[1mmay break at any time\x1B[0;33m.
  15. babel-preset-react-app is part of the create-react-app project, \x1B[1mwhich
  16. is not maintianed anymore\x1B[0;33m. It is thus unlikely that this bug will
  17. ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
  18. your devDependencies to work around this error. This will make this message
  19. go away.\x1B[0m
  20. `);
  21. return;
  22. } catch (e) {}
  23. throw new Error(`\
  24. --- PLACEHOLDER PACKAGE ---
  25. This @babel/plugin-proposal-private-property-in-object version is not meant to
  26. be imported. Something is importing
  27. @babel/plugin-proposal-private-property-in-object without declaring it in its
  28. dependencies (or devDependencies) in the package.json file.
  29. Add "@babel/plugin-proposal-private-property-in-object" to your devDependencies
  30. to work around this error. This will make this message go away.
  31. `);