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

Issue when trying to load uppy with importmap while running an adblocker #4446

Closed
2 tasks done
bolinkd opened this issue May 9, 2023 · 5 comments · Fixed by #4481
Closed
2 tasks done

Issue when trying to load uppy with importmap while running an adblocker #4446

bolinkd opened this issue May 9, 2023 · 5 comments · Fixed by #4481
Assignees
Labels

Comments

@bolinkd
Copy link

bolinkd commented May 9, 2023

Initial checklist

  • I understand this is a bug report and questions should be posted in the Community Forum
  • I searched issues and couldn’t find anything (or linked relevant results below)

Link to runnable example

No response

Steps to reproduce

We have users who have reported being unable to upload files and we have narrowed it down to adblockers blocking the "EventTracker.js" file that importmap is trying to load

  1. Run importmap pin @uppy/xhr-upload
  2. Adds the following lines to the importmap
pin "@uppy/xhr-upload", to: "https://ga.jspm.io/npm:@uppy/xhr-upload@3.2.0/lib/index.js"
pin "@uppy/companion-client", to: "https://ga.jspm.io/npm:@uppy/companion-client@3.1.3/lib/index.js"
pin "@uppy/core/lib/BasePlugin.js", to: "https://ga.jspm.io/npm:@uppy/core@3.2.0/lib/BasePlugin.js"
pin "@uppy/utils/lib/ErrorWithCause", to: "https://ga.jspm.io/npm:@uppy/utils@5.3.0/lib/ErrorWithCause.js"
pin "@uppy/utils/lib/EventTracker", to: "https://ga.jspm.io/npm:@uppy/utils@5.3.0/lib/EventTracker.js"
pin "@uppy/utils/lib/NetworkError", to: "https://ga.jspm.io/npm:@uppy/utils@5.3.0/lib/NetworkError.js"
pin "@uppy/utils/lib/ProgressTimeout", to: "https://ga.jspm.io/npm:@uppy/utils@5.3.0/lib/ProgressTimeout.js"
pin "@uppy/utils/lib/RateLimitedQueue", to: "https://ga.jspm.io/npm:@uppy/utils@5.3.0/lib/RateLimitedQueue.js"
pin "@uppy/utils/lib/Translator", to: "https://ga.jspm.io/npm:@uppy/utils@5.3.0/lib/Translator.js"
pin "@uppy/utils/lib/emitSocketProgress", to: "https://ga.jspm.io/npm:@uppy/utils@5.3.0/lib/emitSocketProgress.js"
pin "@uppy/utils/lib/fetchWithNetworkError", to: "https://ga.jspm.io/npm:@uppy/utils@5.3.0/lib/fetchWithNetworkError.js"
pin "@uppy/utils/lib/fileFilters", to: "https://ga.jspm.io/npm:@uppy/utils@5.3.0/lib/fileFilters.js"
pin "@uppy/utils/lib/getSocketHost", to: "https://ga.jspm.io/npm:@uppy/utils@5.3.0/lib/getSocketHost.js"
pin "@uppy/utils/lib/isNetworkError", to: "https://ga.jspm.io/npm:@uppy/utils@5.3.0/lib/isNetworkError.js"
pin "lodash.throttle", to: "https://ga.jspm.io/npm:lodash.throttle@4.1.1/index.js"
pin "namespace-emitter", to: "https://ga.jspm.io/npm:namespace-emitter@2.0.1/index.js"
pin "nanoid/non-secure", to: "https://ga.jspm.io/npm:nanoid@4.0.2/non-secure/index.js"
  1. Start up server and try to load a page that loads uppy with ublock installed
  2. Notice that "@uppy/utils/lib/EventTracker" fails to load
    Screenshot 2023-05-09 at 10 33 37
    Screenshot 2023-05-09 at 10 33 50

Expected behavior

I would expect Uppy to load without being blocked by adblockers, I believe the issue is with the naming of the EventTracker file and the default rules in ublock (The adblocker that initially caused the issue for us) is blocking the network request because of the suspicious name.

Actual behavior

The file is blocked by the adblocker

@stredger
Copy link

This behaviour can be easily observed by:

  1. having uBlock Origin installed
  2. navigating to the JSPM online generator https://generator.jspm.io/
  3. Adding uppy as a dependency

@aduh95
Copy link
Contributor

aduh95 commented May 25, 2023

That seems unfortunate, but I'm not sure there's much we can do (besides renaming the file maybe). Did you try to report that to uBlock Origin? That seems a false positive on their end.

@Murderlon
Copy link
Member

I don't think we can report it to uBlock as their whole tactic is speculative blocking. Renaming would be the best option. We did the same for tus: tus/tus-js-client#429

@Murderlon
Copy link
Member

@bolinkd are you willing to make a PR?

@quigebo
Copy link
Contributor

quigebo commented Jun 3, 2023

@Murderlon I made a PR which was a global find and replace. I'm not sure how to test this locally with Rails importmaps, unfortunately

@aduh95 aduh95 linked a pull request Jun 10, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants