react-loosely-lazy icon indicating copy to clipboard operation
react-loosely-lazy copied to clipboard

Parcel manifest reporter fails assertion when bundle is inlined

Open marcins opened this issue 2 years ago • 0 comments

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.

marcins avatar Oct 19 '22 00:10 marcins