Allows multiple lines for Module not found errors (#10797)

Next is currently removing useful information from the PnP error messages.

Before:

```
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
```

After:

```
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

Required package: foo (via "foo/components/Avatar")
Required by: /home/arcanis/foo/bar.tsx
```
This commit is contained in:
Maël Nison 2020-05-24 01:11:46 +02:00 committed by GitHub
parent 846ec74013
commit 52fd6b1832
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,6 +86,7 @@ function formatMessage(message) {
lines[1]
.replace('Error: ', '')
.replace('Module not found: Cannot find file:', 'Cannot find file:'),
...lines.slice(2).filter((line) => line.indexOf(' @ ') !== 0),
]
}