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

Unable make it work with Remix #52

Open
Loschcode opened this issue Mar 21, 2024 · 1 comment
Open

Unable make it work with Remix #52

Loschcode opened this issue Mar 21, 2024 · 1 comment

Comments

@Loschcode
Copy link

I'm on a Remix project, I added simple crypto through pnpm then on top of my file I just added

import SimpleCrypto from "simple-crypto-js";

const secretKey = "some-unique-key";
const crypto = new SimpleCrypto(secretKey);

But this doesn't work properly with Remix build

 info  rebuilding... (~ app/routes/_tools.qr-code-time-tracking.tsx)
 info  rebuilt (496ms)
TypeError: SimpleCrypto is not a constructor
    at file:///...website/app/routes/_tools.qr-code-time-tracking.tsx:12:16
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25)

Do you know what could be going on right now?

@Loschcode Loschcode changed the title Unable to instantiate simple crypto with Remix Unable make it work with Remix Mar 21, 2024
@Loschcode
Copy link
Author

Loschcode commented Mar 21, 2024

Your documentation is wrong, you should import it this way

import { SimpleCrypto } from "simple-crypto-js";

I'd advise updating your doc because other people might see it crash.

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

1 participant