react-loosely-lazy
react-loosely-lazy copied to clipboard
Parcel manifest reporter fails assertion when bundle is inlined
When a bundle is "inlined", for example when an SVG import should result in an SVG string, the @react-loosely-lazy/parcel-reporter-manifest
fails because it expects referencedBundles
to all have a filePath.
There needs to be an additional check before trying to access filePath
of a referencedBundle
to assert that the entry of the bundle isn't inlined. https://github.com/atlassian-labs/react-loosely-lazy/blob/5d0f0437cb9cab2173d9fb02b0f9322a63648826/packages/plugins/parcel-reporter-manifest/src/utils.ts#L95-L99
Something like:
if (referencedBundle.bundleBehavior === 'inline') continue;
Possibly this should also be raised with the Parcel project, because accessing the filePath
should probably return null
not fail an assertion.