metafloor / bwip-js

Barcode Writer in Pure JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uncaught ReferenceError: BwipJs is not defined - Runtime error

kjell-van-straaten opened this issue · comments

hi, I am trying to use your package to render a data matrix svg. Looks pretty useful, but unfortunately I am getting a runtime error in my console, which my editor doesn't flag.

Code:
import bwipjs from 'bwip-js';

Browser Console:

Uncaught ReferenceError: BwipJs is not defined.

Terminal:

no issues found

Using:
React 18.2 (typescript, vite)
bwip-js: 4.2.0

Any clue how to proceed? I haven't managed to solve this with the help of the web unfortunately.

Without seeing the code, I would suspect you have a typo on BwipJs. Your import name is bwipjs.

i deleted my .vite/dep folder and now it works. Somehow the dependency broke