Issue 1:
Do you want to request a feature or report a bug?

bug

What is the current behavior?

Edit: To clarify, importing SVGs directly works fine, as described here: https://create-react-app.dev/docs/adding-images-fonts-and-files/#adding-svgs. It only fails when used indirectly through an NPM package.

When using a Component that contains an SVG referenced in a package using the pattern `import {ReactComponent as Foo} from "./foo.svg"', React raises this error:

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of Foo.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:

Reproduced here: https://github.com/neolefty/indirect-svg

What is the expected behavior?

An SVG imported using import {ReactComponent as Foo} from "./foo.svg" in an NPM package should render in a project that depends on it.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

Found in 16.12.0 / Linux / Chrome. Not tested in previous versions of React.

Issue 2:
Describe what you were doing when the bug occurred:

Turn on Profiler

The app sens a lot of small requests to BE

To make sure that all requests fulfilled, I went to Network TAB. When it was finished and stop profiling.

The profiler showed some results and then crashed.

Please do not remove the text below this line

DevTools version: 4.8.2-fed4ae024

Call stack: at updateTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:17786:17)

at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:17717:25)

at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:17710:30)

at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:17710:30)

at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:17710:30)

at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:17710:30)

at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:17710:30)

at getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:17710:30)

at ProfilingCache.getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:18265:14)

at CommitFlamegraphAutoSizer (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:31718:33)

Component stack: at CommitFlamegraphAutoSizer (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:31701:48)

at div

at div

at div

at SettingsModalContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:26139:23)

at Profiler_Profiler (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:33363:48)

at ErrorBoundary (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:27172:5)

at PortaledContent (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:27303:32)

at div

at div

at ProfilerContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:30463:23)

at TreeContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:22538:23)

at SettingsContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:23040:27)

at ModalDialogContextController (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:28328:23)

at DevTools_DevTools (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:33797:21)