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

Version 5.2.4 and 5.2.5 - problem with document.currentScript.src when running tests with karma and webpack #1756

Closed
5 of 6 tasks
rjaros opened this issue Sep 19, 2021 · 3 comments

Comments

@rjaros
Copy link

rjaros commented Sep 19, 2021

Prerequisites

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • The issue still exists against the latest master branch of bootstrap-fileinput.
  • This is not an usage question. I confirm having read the plugin documentation and demos.
  • This is not a general programming / coding question. (Those should be directed to the webtips Q & A forum).
  • I have attempted to find the simplest possible steps to reproduce the issue.
  • I have included a failing test as a pull request (Optional).

Libraries

  • bootstrap-fileinput version: 5.2.4, 5.2.5

The change introduced in this commit - 22ce1ed#diff-336f513b57ac7d4ac2af892a5fdc467725efd1b7c47b3eaa2ec64fbb6935f2da
makes the component fail when running tests with webpack and karma, because document.currentScript property is null in such environment. It would be great if some fallback could be provided (e.g. returning empty string from getLoadingUrl() when currentScript is null). I've tried to workaround the issue but without success.

Unfortunately I can't provide a simple example to reproduce the problem.

@kartik-v
Copy link
Owner

Enhancement provided. Will tag a new release later after more testing.

@rjaros
Copy link
Author

rjaros commented Sep 23, 2021

It would be great to have new release. I have reports from users of my framework, which uses your component with webpack, they are affected by this issue not only in tests. Thank you for all your effort!

@kartik-v
Copy link
Owner

kartik-v commented Sep 23, 2021

v5.2.6 has been released. Been a bit busy to tag it.

--
If you like our plugins do help us by donating

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

No branches or pull requests

2 participants