Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error in case bundle.getMainEntry() returns null #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ap--
Copy link

@ap-- ap-- commented Oct 5, 2021

Hi @vseventer

I've tried your parcel plugin and basically ran directly into issue #3
This commit fixes the problem for me.
I'm not familiar enough with parcel to judge if it's the correct fix though.

Cheers,
Andreas 😃

@JaredSartin
Copy link

This still appends hashes to split files, correct?

The reason this is being hit is because the bundle contains too many files (or is too large) and Parcel is splitting the file to share code and make load times faster. The namer couldn't determine the base file name and would error out here.

What does your build directory look like with this fix?

@ap--
Copy link
Author

ap-- commented Oct 17, 2021

Hi @JaredSartin

This still appends hashes to split files, correct?

I think so. tbh, I'm not too familiar with frontend development and was using parcel v1 with another renaming plugin just fine. But then was forced to migrate to v2 because of parcel-bundler/parcel#2408
And the migration to v2 was, let's say not so smooth.
So far this made it work, but I'm not sure if it introduces other bugs.

The reason this is being hit is because the bundle contains too many files (or is too large) and Parcel is splitting the file to share code and make load times faster. The namer couldn't determine the base file name and would error out here.

What does your build directory look like with this fix?

What would be a good test case that I could prepare to help diagnose if all of this works fine for large bundles?

Cheers,
Andreas 😃

@JaredSartin
Copy link

JaredSartin commented Oct 17, 2021 via email

@ap--
Copy link
Author

ap-- commented Oct 17, 2021

(Sorry. On mobile, hopefully my description makes sense)

it does :) Thanks for the pointer. I'll try to report back in 2 or 3 days.

@bikehara-ias
Copy link

This still appends hashes to split files, correct?

Can confirm this works with split files. Due to the bundler splitting behavior, [hash] is required as part of the file name to ensure files names will be unique.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants