lindell / lindell/JsBarcode

JSBarcode of Undefined when invalid JQuery is passed

Open
#223 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5.9k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

When the library code executes, if it encounters an `jQuery` object which has not been fully initailized or in invalid. JSBarcode throws a error TypeError: Cannot set property 'JSBarcode' of undefined.

Steps to reproduce
1) Inject a broken jQuery into the HTML file ( jQuery = {}; ).
2) Try to render the page with JSBarcode.

The broken jQuery maybe cause of incomplete code injection (due to slow network) of any plugin added as extension.
![console](https://user-images.githubusercontent.com/22388966/36301830-338343c8-132c-11e8-9bc2-ac59e26cd255.png)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the browser case described in the issue: load JSBarcode after setting jQuery to an empty object, then trace where the jQuery integration is initialized. Confirm the expected behavior for this invalid dependency state and verify that rendering no longer produces the reported TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.