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: crash when using filesystem cache #460

Merged
merged 3 commits into from
Dec 18, 2024
Merged

fix: crash when using filesystem cache #460

merged 3 commits into from
Dec 18, 2024

Conversation

alexander-akait
Copy link
Member

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

fixes #458
fixes #459

Breaking Changes

No

Additional Info

Let's refactor to avoid misleading logic, because we need it only for URLs, also let's cache this

ABSOLUTE_URL_REGEX.test(this.resourcePath) &&
!WINDOWS_PATH_REGEX.test(this.resourcePath)
? this.resourcePath
: this.utils.contextify(this.rootContext, this.resourcePath);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexander-akait

The filename must be a relative path without leading ./:

  • this.utils.contextify(this.rootContext, this.resourcePath) => ./src/image.svg (❌ wrong filename)
  • path.relative(this.rootContext, this.resourcePath) => src/image.svg (✅ correct filename)

Please, see the details in my updated comment
I have linked the NEW small as possible repo with reproducible issue.

Thank you!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this PR doesn't fix the issue

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strange, I'll have a look now

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now with tests 😄

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexander-akait

it works now :-)
thank you!

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.

Webpack compilations fail when using filesystem cache
2 participants