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

Problem via NPM install setup #2

Closed
DSoftwareArtist opened this issue Mar 3, 2023 · 2 comments
Closed

Problem via NPM install setup #2

DSoftwareArtist opened this issue Mar 3, 2023 · 2 comments

Comments

@DSoftwareArtist
Copy link

installing this package using npm install @bitjson/qr-code and importing this way don't worked:

<script src="/node_modules/@bitjson/qr-code/dist/qr-code.js"></script>
<script src="/node_modules/@bitjson/qr-code/dist/qr-code/qr-code.orxjfzvr.js" type="module" crossorigin="true" data-resources-url="/node_modules/@bitjson/qr-code/dist/qr-code/" data-namespace="qr-code"></script>

Or even importing this way:

<script src="/node_modules/@bitjson/qr-code/dist/qr-code.js"></script>

I personally don't want to use CDN because I want to load the script from local storage.

I have the feeling that the package installed during npm install is not updated. Please help me on this.

@Roba1993
Copy link

Roba1993 commented Apr 6, 2024

I'm facing the same problem. Is there any fix?

@chajnetajaroslaw
Copy link

chajnetajaroslaw commented Aug 9, 2024

Import it as:

import * as qr from "@bitjson/qr-code";

then run defineCustomElements with window as parameter, now you can use component. some parameters will be autocompleted incorrectly in IDE eg. position-ring-color as PositionRingColor, position-center-color as PositionCenterColor.

qr.defineCustomElements(window);

<qr-code contents="https://bitjson.com"></qr-code>

Stackblitz

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

3 participants