Berry: [Bug] Absolute imports with React CRA

Created on 26 Jan 2020  Â·  19Comments  Â·  Source: yarnpkg/berry

  • [ ] I'd be willing to implement a fix

Describe the bug

Absolute imports doesn't work in CRA.
import App from 'folder-in-src/App'

To Reproduce

``js repro const path = require(path); const {promises: {writeFile}} = require(fs`);

await yarn(dlx, create-react-app, test)
process.chdir(path.resolve(process.cwd(), 'test'));

await writeFile("jsconfig.json", { "compilerOptions": { "baseUrl": "src/" } } )

await writeFile("src/Component1.jsx", `
import React from 'react';

function Component1() {
return

hello world

}

export default Component1;
`)

await writeFile("src/App.jsx", `
import React from 'react';
import Component1 from 'Component1';

function App() {
return
}

export default App;
`)

await expect(yarn(build)).rejects.not.toThrow(
/Module not found/
);

npx create-react-app test
add a jsconfig.json

{
"compilerOptions": {
"baseUrl": "src/"
}
}

try to use an absolute import (supported in CRA + works fine in yarn1)
``` import App from 'folder-in-src/App' ```

You get

./src/App.jsx
Module not found: Something that got detected as your top-level application (because it doesn't
seem to belong to any package) tried to access a package that is not declared in your dependencies
```
Works fine with yarn 1

  • Windows
  • Node version 13.6
  • Yarn version 2.0.0-rc27
bug reproducible

Most helpful comment

Would be nice to have a Sherlock playground ... not sure how to do that though 🤔

All 19 comments

What did you do by "try to use an absolute import"?

Maybe you can write a repro in your issue: https://next.yarnpkg.com/advanced/sherlock
(It's up to you to complete the following repro -- I am not sure if it can work)

`markdown js repro
const {promises: {writeFile}} = require(fs);

await yarn(dlx, create-react-app)

await writeFile("jsconfig.json", { "compilerOptions": { "baseUrl": "src/" } } )

await writeFile("src/App.jsx", // demo your "absolute imports" )

await expect(yarn(build)).rejects.not.toThrow(
/Module not found/
);
```
````

The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):

Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js dlx create-react-app
Please specify the project directory:

➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 1.88s
➤ YN0000: ┌ Fetch step
➤ YN0013: │ ansi-styles@npm:3.2.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ balanced-match@npm:1.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ ansi-escapes@npm:3.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ ansi-regex@npm:3.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ ansi-regex@npm:4.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ block-stream@npm:0.0.9 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ brace-expansion@npm:1.1.11 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ buffer-from@npm:0.1.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ builtins@npm:1.0.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ chalk@npm:2.4.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ chardet@npm:0.7.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ cli-cursor@npm:2.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ cli-width@npm:2.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ color-convert@npm:1.9.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ color-name@npm:1.1.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ commander@npm:2.20.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ core-util-is@npm:1.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ concat-map@npm:0.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ create-react-app@npm:3.3.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ cross-spawn@npm:6.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ debug@npm:2.6.9 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ duplexer2@npm:0.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ envinfo@npm:7.5.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ escape-string-regexp@npm:1.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ external-editor@npm:3.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ figures@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ fs-extra@npm:7.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ fs.realpath@npm:1.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ fstream-ignore@npm:1.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ fstream@npm:1.0.12 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ glob@npm:7.1.6 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ graceful-fs@npm:4.2.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ has-flag@npm:3.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ hyperquest@npm:2.1.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ iconv-lite@npm:0.4.24 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ inflight@npm:1.0.6 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ inherits@npm:2.0.4 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ inquirer@npm:6.5.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ is-fullwidth-code-point@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ is-promise@npm:2.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ isarray@npm:0.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ isarray@npm:1.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ isexe@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ jsonfile@npm:4.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ lodash@npm:4.17.15 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ mimic-fn@npm:1.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ minimatch@npm:3.0.4 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ minimist@npm:0.0.8 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ mkdirp@npm:0.5.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ ms@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ mute-stream@npm:0.0.7 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ nice-try@npm:1.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ once@npm:1.4.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ onetime@npm:2.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ os-tmpdir@npm:1.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ path-is-absolute@npm:1.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ path-key@npm:2.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ process-nextick-args@npm:2.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ readable-stream@npm:1.0.34 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ readable-stream@npm:1.1.14 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ readable-stream@npm:2.3.7 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ restore-cursor@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ rimraf@npm:2.7.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ run-async@npm:2.3.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ rxjs@npm:6.5.4 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ safe-buffer@npm:5.1.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ safer-buffer@npm:2.1.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ semver@npm:5.7.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ semver@npm:6.3.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ shebang-command@npm:1.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ shebang-regex@npm:1.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ signal-exit@npm:3.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ string-width@npm:2.1.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ string_decoder@npm:0.10.31 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ string_decoder@npm:1.1.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ strip-ansi@npm:4.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ strip-ansi@npm:5.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ supports-color@npm:5.5.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ tar-pack@npm:3.4.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ tar@npm:2.2.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ through2@npm:0.6.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ through@npm:2.3.8 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ tmp@npm:0.0.33 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ tslib@npm:1.10.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ uid-number@npm:0.0.6 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ universalify@npm:0.1.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ util-deprecate@npm:1.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ validate-npm-package-name@npm:3.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ which@npm:1.3.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ wrappy@npm:1.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ xtend@npm:4.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0000: └ Completed in 4.84s
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 0.31s
➤ YN0000: Done in 7.04s

  create-react-app <project-directory>

For example:
  create-react-app my-react-app

Run create-react-app --help to see all options.

    at ChildProcess.exithandler (child_process.js:295:12)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it into await expect(...).rejects.toThrow().

The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):

Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js dlx create-react-app
Please specify the project directory:

➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 1.72s
➤ YN0000: ┌ Fetch step
➤ YN0013: │ ansi-styles@npm:3.2.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ balanced-match@npm:1.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ ansi-escapes@npm:3.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ ansi-regex@npm:3.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ ansi-regex@npm:4.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ block-stream@npm:0.0.9 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ brace-expansion@npm:1.1.11 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ buffer-from@npm:0.1.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ builtins@npm:1.0.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ chalk@npm:2.4.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ chardet@npm:0.7.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ cli-cursor@npm:2.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ cli-width@npm:2.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ color-convert@npm:1.9.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ color-name@npm:1.1.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ commander@npm:2.20.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ concat-map@npm:0.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ core-util-is@npm:1.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ create-react-app@npm:3.3.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ cross-spawn@npm:6.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ debug@npm:2.6.9 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ duplexer2@npm:0.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ envinfo@npm:7.5.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ escape-string-regexp@npm:1.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ external-editor@npm:3.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ figures@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ fs-extra@npm:7.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ fs.realpath@npm:1.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ fstream-ignore@npm:1.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ fstream@npm:1.0.12 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ glob@npm:7.1.6 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ graceful-fs@npm:4.2.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ has-flag@npm:3.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ hyperquest@npm:2.1.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ iconv-lite@npm:0.4.24 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ inflight@npm:1.0.6 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ inherits@npm:2.0.4 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ inquirer@npm:6.5.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ is-fullwidth-code-point@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ is-promise@npm:2.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ isarray@npm:0.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ isarray@npm:1.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ isexe@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ jsonfile@npm:4.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ lodash@npm:4.17.15 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ mimic-fn@npm:1.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ minimatch@npm:3.0.4 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ minimist@npm:0.0.8 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ mkdirp@npm:0.5.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ ms@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ mute-stream@npm:0.0.7 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ nice-try@npm:1.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ once@npm:1.4.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ onetime@npm:2.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ os-tmpdir@npm:1.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ path-is-absolute@npm:1.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ path-key@npm:2.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ process-nextick-args@npm:2.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ readable-stream@npm:1.0.34 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ readable-stream@npm:1.1.14 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ readable-stream@npm:2.3.7 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ restore-cursor@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ rimraf@npm:2.7.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ run-async@npm:2.3.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ rxjs@npm:6.5.4 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ safe-buffer@npm:5.1.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ safer-buffer@npm:2.1.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ semver@npm:5.7.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ semver@npm:6.3.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ shebang-command@npm:1.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ shebang-regex@npm:1.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ signal-exit@npm:3.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ string-width@npm:2.1.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ string_decoder@npm:0.10.31 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ string_decoder@npm:1.1.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ strip-ansi@npm:4.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ strip-ansi@npm:5.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ supports-color@npm:5.5.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ tar-pack@npm:3.4.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ tar@npm:2.2.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ through2@npm:0.6.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ through@npm:2.3.8 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ tmp@npm:0.0.33 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ tslib@npm:1.10.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ uid-number@npm:0.0.6 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ universalify@npm:0.1.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ util-deprecate@npm:1.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ validate-npm-package-name@npm:3.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ which@npm:1.3.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ wrappy@npm:1.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ xtend@npm:4.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0000: └ Completed in 4.41s
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 0.28s
➤ YN0000: Done in 6.42s

  create-react-app <project-directory>

For example:
  create-react-app my-react-app

Run create-react-app --help to see all options.

    at ChildProcess.exithandler (child_process.js:295:12)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it into await expect(...).rejects.toThrow().

The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):

Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js dlx create-react-app
Please specify the project directory:

➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 1.81s
➤ YN0000: ┌ Fetch step
➤ YN0013: │ ansi-styles@npm:3.2.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ balanced-match@npm:1.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ ansi-escapes@npm:3.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ ansi-regex@npm:3.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ ansi-regex@npm:4.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ block-stream@npm:0.0.9 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ brace-expansion@npm:1.1.11 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ buffer-from@npm:0.1.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ builtins@npm:1.0.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ chalk@npm:2.4.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ chardet@npm:0.7.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ cli-cursor@npm:2.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ cli-width@npm:2.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ color-convert@npm:1.9.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ color-name@npm:1.1.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ commander@npm:2.20.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ concat-map@npm:0.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ core-util-is@npm:1.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ create-react-app@npm:3.3.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ cross-spawn@npm:6.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ debug@npm:2.6.9 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ duplexer2@npm:0.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ envinfo@npm:7.5.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ escape-string-regexp@npm:1.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ external-editor@npm:3.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ figures@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ fs-extra@npm:7.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ fs.realpath@npm:1.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ fstream-ignore@npm:1.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ fstream@npm:1.0.12 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ glob@npm:7.1.6 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ graceful-fs@npm:4.2.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ has-flag@npm:3.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ hyperquest@npm:2.1.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ iconv-lite@npm:0.4.24 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ inflight@npm:1.0.6 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ inherits@npm:2.0.4 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ inquirer@npm:6.5.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ is-fullwidth-code-point@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ is-promise@npm:2.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ isarray@npm:0.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ isarray@npm:1.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ isexe@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ jsonfile@npm:4.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ lodash@npm:4.17.15 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ mimic-fn@npm:1.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ minimatch@npm:3.0.4 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ minimist@npm:0.0.8 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ mkdirp@npm:0.5.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ ms@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ mute-stream@npm:0.0.7 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ nice-try@npm:1.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ once@npm:1.4.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ onetime@npm:2.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ os-tmpdir@npm:1.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ path-is-absolute@npm:1.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ path-key@npm:2.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ process-nextick-args@npm:2.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ readable-stream@npm:1.0.34 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ readable-stream@npm:1.1.14 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ readable-stream@npm:2.3.7 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ restore-cursor@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ rimraf@npm:2.7.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ run-async@npm:2.3.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ rxjs@npm:6.5.4 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ safe-buffer@npm:5.1.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ safer-buffer@npm:2.1.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ semver@npm:5.7.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ semver@npm:6.3.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ shebang-command@npm:1.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ shebang-regex@npm:1.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ signal-exit@npm:3.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ string-width@npm:2.1.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ string_decoder@npm:0.10.31 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ string_decoder@npm:1.1.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ strip-ansi@npm:4.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ strip-ansi@npm:5.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ supports-color@npm:5.5.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ tar-pack@npm:3.4.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ tar@npm:2.2.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ through2@npm:0.6.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ through@npm:2.3.8 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ tmp@npm:0.0.33 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ tslib@npm:1.10.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ uid-number@npm:0.0.6 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ universalify@npm:0.1.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ util-deprecate@npm:1.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ validate-npm-package-name@npm:3.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ which@npm:1.3.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ wrappy@npm:1.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ xtend@npm:4.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0000: └ Completed in 5.02s
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 0.31s
➤ YN0000: Done in 7.15s

  create-react-app <project-directory>

For example:
  create-react-app my-react-app

Run create-react-app --help to see all options.

    at ChildProcess.exithandler (child_process.js:295:12)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it into await expect(...).rejects.toThrow().

I think it's worth to try

await yarn(`dlx`, `create-react-app`, `.`)

The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):

Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js dlx create-react-app .

➤ BR0027: create-react-app .@unknown can't be resolved to a satisfying range
➤ Errors happened when preparing the environment required to run this command.

    at ChildProcess.exithandler (child_process.js:295:12)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it into await expect(...).rejects.toThrow().

The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):

Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js dlx create-react-app .

➤ BR0027: create-react-app .@unknown can't be resolved to a satisfying range
➤ Errors happened when preparing the environment required to run this command.

    at ChildProcess.exithandler (child_process.js:295:12)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it into await expect(...).rejects.toThrow().

The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):

Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js dlx create-react-app .

➤ BR0027: create-react-app .@unknown can't be resolved to a satisfying range
➤ Errors happened when preparing the environment required to run this command.

    at ChildProcess.exithandler (child_process.js:295:12)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it into await expect(...).rejects.toThrow().

The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):

Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js dlx create-react-app .
Could not create a project called "tmp-2764X4nJNqbGJV" because of npm naming restrictions:
  *  name can no longer contain capital letters

➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 1.78s
➤ YN0000: ┌ Fetch step
➤ YN0013: │ ansi-styles@npm:3.2.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ balanced-match@npm:1.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ ansi-escapes@npm:3.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ ansi-regex@npm:3.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ ansi-regex@npm:4.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ block-stream@npm:0.0.9 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ brace-expansion@npm:1.1.11 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ buffer-from@npm:0.1.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ builtins@npm:1.0.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ chalk@npm:2.4.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ chardet@npm:0.7.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ cli-cursor@npm:2.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ cli-width@npm:2.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ color-convert@npm:1.9.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ color-name@npm:1.1.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ commander@npm:2.20.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ concat-map@npm:0.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ core-util-is@npm:1.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ create-react-app@npm:3.3.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ cross-spawn@npm:6.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ debug@npm:2.6.9 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ duplexer2@npm:0.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ envinfo@npm:7.5.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ escape-string-regexp@npm:1.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ external-editor@npm:3.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ figures@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ fs-extra@npm:7.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ fs.realpath@npm:1.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ fstream-ignore@npm:1.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ fstream@npm:1.0.12 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ glob@npm:7.1.6 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ graceful-fs@npm:4.2.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ has-flag@npm:3.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ hyperquest@npm:2.1.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ iconv-lite@npm:0.4.24 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ inflight@npm:1.0.6 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ inherits@npm:2.0.4 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ inquirer@npm:6.5.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ is-fullwidth-code-point@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ is-promise@npm:2.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ isarray@npm:0.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ isarray@npm:1.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ isexe@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ jsonfile@npm:4.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ lodash@npm:4.17.15 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ mimic-fn@npm:1.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ minimatch@npm:3.0.4 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ minimist@npm:0.0.8 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ mkdirp@npm:0.5.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ ms@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ mute-stream@npm:0.0.7 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ nice-try@npm:1.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ once@npm:1.4.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ onetime@npm:2.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ os-tmpdir@npm:1.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ path-is-absolute@npm:1.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ path-key@npm:2.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ process-nextick-args@npm:2.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ readable-stream@npm:1.0.34 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ readable-stream@npm:1.1.14 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ readable-stream@npm:2.3.7 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ restore-cursor@npm:2.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ rimraf@npm:2.7.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ run-async@npm:2.3.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ rxjs@npm:6.5.4 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ safe-buffer@npm:5.1.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ safer-buffer@npm:2.1.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ semver@npm:5.7.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ semver@npm:6.3.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ shebang-command@npm:1.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ shebang-regex@npm:1.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ signal-exit@npm:3.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ string-width@npm:2.1.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ string_decoder@npm:0.10.31 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ string_decoder@npm:1.1.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ strip-ansi@npm:4.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ strip-ansi@npm:5.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ supports-color@npm:5.5.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ tar-pack@npm:3.4.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ tar@npm:2.2.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ through2@npm:0.6.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ through@npm:2.3.8 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ tmp@npm:0.0.33 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ tslib@npm:1.10.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ uid-number@npm:0.0.6 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ universalify@npm:0.1.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ util-deprecate@npm:1.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ validate-npm-package-name@npm:3.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ which@npm:1.3.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ wrappy@npm:1.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ xtend@npm:4.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0000: └ Completed in 4.62s
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 0.28s
➤ YN0000: Done in 6.69s


    at ChildProcess.exithandler (child_process.js:295:12)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it into await expect(...).rejects.toThrow().

await yarn(`dlx`, `create-react-app`, `test`)
process.chdir(path.resolve(process.cwd(), 'test'));

(ref: https://github.com/yarnpkg/berry/issues/689#issue-549324764)

Would be nice to have a Sherlock playground ... not sure how to do that though 🤔

Would be nice to have a Sherlock playground ... not sure how to do that though 🤔

I'm really struggling with this sherlock thing here. A playground would be nice. Probably a more detailed documentation could also help.

The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):

ReferenceError: path is not defined
    at module.exports (evalmachine.<anonymous>:5:15)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async /github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-1.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:56:13
    at async executeInTempDirectory (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-1.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:17:16)
    at async Object.executeRepro (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-1.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:24:12)
    at async ExecCommand.execute (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-1.zip/node_modules/@arcanis/sherlock/lib/commands/exec.js:25:38)
    at async ExecCommand.validateAndExecute (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-1.zip/node_modules/clipanion/lib/advanced/Command.js:161:26)
    at async Cli.run (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-1.zip/node_modules/clipanion/lib/advanced/Cli.js:74:24)
    at async Cli.runExit (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-1.zip/node_modules/clipanion/lib/advanced/Cli.js:83:28)

Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it into await expect(...).rejects.toThrow().

Note that you can work on the repro locally - it's a bit faster to iterate:
https://yarnpkg.com/advanced/sherlock#can-i-develop-my-reproduction-offline

This issue reproduces on master:

Error: expect(received).rejects.not.toThrow()

Received promise resolved instead of rejected
Resolved to value: "Creating an optimized production build...
Compiled successfully.

File sizes after gzip:

  39.93 KB  build/static/js/2.1f07b838.chunk.js
  770 B     build/static/js/runtime-main.b09effc8.js
  605 B     build/static/js/main.58d0d6e1.chunk.js
  547 B     build/static/css/main.d1b05096.chunk.css

The project was built assuming it is hosted at the server root.
You can control this with the homepage field in your package.json.
For example, add this to build it for GitHub Pages:

  \"homepage\" : \"http://myname.github.io/myapp\",

The build folder is ready to be deployed.
You may serve it with a static server:

  yarn global add serve
  serve -s build

Find out more about deployment here:

  bit.ly/CRA-deploy

"
    at expect (/github/workspace/.yarn/cache/expect-npm-24.8.0-8c7640c562-1.zip/node_modules/expect/build/index.js:138:15)
    at module.exports (evalmachine.<anonymous>:37:7)
    at async /github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-1.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:56:13
    at async executeInTempDirectory (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-1.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:17:16)
    at async Object.executeRepro (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-1.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:24:12)
    at async ExecCommand.execute (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-1.zip/node_modules/@arcanis/sherlock/lib/commands/exec.js:25:38)
    at async ExecCommand.validateAndExecute (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-1.zip/node_modules/clipanion/lib/advanced/Command.js:161:26)
    at async Cli.run (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-1.zip/node_modules/clipanion/lib/advanced/Cli.js:74:24)
    at async Cli.runExit (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-1.zip/node_modules/clipanion/lib/advanced/Cli.js:83:28)

Would be nice to have a Sherlock playground ... not sure how to do that though 🤔

off-topic?: What about something like this CodeSandbox template?

I just ran into this issue with one of my projects and see this is closed now. Was there a solution found?

There was no valid reproduction (the last one published was bogus), so hard to say. Open a new issue with a repro if needed.

Ok, referencing https://github.com/facebook/create-react-app/issues/7996 and https://next.yarnpkg.com/advanced/migration#dont-use-resolvealiasmodules-webpack-or-modulenamemapper-jest for anyone else stumbling here in the meantime

Was this page helpful?
0 / 5 - 0 ratings