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

Upgrade to v2.1.0 from 2.0.1 breaks server dependencies because of dynamic import #120

Open
3 tasks done
ten-x-dev opened this issue Jan 20, 2024 · 0 comments
Open
3 tasks done

Comments

@ten-x-dev
Copy link

โœ… Prerequisites

  • Did you perform a cursory search of open issues? Is this bug already reported elsewhere?
  • Are you running the latest SDK version?
  • Are you reporting to the correct repository (@magic-sdk/admin)?

๐Ÿ› Description

Upgrading to the new version of magic breaks the server because of the dynamic import of the crypto module.

Run npx playwright test --project=chromium
[WebServer] Error: Dynamic require of "crypto" is not supported
    at file:///home/runner/work/french-house-stack/french-house-stack/build/index.js?t=1705785829014.18:12:9
    at node_modules/@noble/hashes/crypto.js (file:///home/runner/work/french-house-stack/french-house-stack/build/index.js?t=1705785829014.18:1[10](https://github.com/ten-x-dev/french-house-stack/actions/runs/7596904096/job/20691132649?pr=256#step:7:11)0:40)
    at file:///home/runner/work/french-house-stack/french-house-stack/build/index.js?t=1705785829014.18:1019:55
    at node_modules/@noble/hashes/utils.js (file:///home/runner/work/french-house-stack/french-house-stack/build/index.js?t=1705785829014.18:[11](https://github.com/ten-x-dev/french-house-stack/actions/runs/7596904096/job/20691132649?pr=256#step:7:12)10:24)
    at file:///home/runner/work/french-house-stack/french-house-stack/build/index.js?t=1705785829014.18:1019:55
    at node_modules/@noble/hashes/sha3.js (file:///home/runner/work/french-house-stack/french-house-stack/build/index.js?t=1705785829014.18:[12](https://github.com/ten-x-dev/french-house-stack/actions/runs/7596904096/job/20691132649?pr=256#step:7:13)62:61)
    at file:///home/runner/work/french-house-stack/french-house-stack/build/index.js?t=1705785829014.18:1019:55
    at node_modules/ethereum-cryptography/keccak.js (file:///home/runner/work/french-house-stack/french-house-stack/build/index.js?t=17057858290[14](https://github.com/ten-x-dev/french-house-stack/actions/runs/7596904096/job/20691132649?pr=256#step:7:15).18:1445:33)
    at file:///home/runner/work/french-house-stack/french-house-stack/build/index.js?t=1705785829014.18:1019:55
    at node_modules/@magic-sdk/admin/dist/esm/index.js (file:///home/runner/work/french-house-stack/french-house-stack/build/index.js?t=[17](https://github.com/ten-x-dev/french-house-stack/actions/runs/7596904096/job/20691132649?pr=256#step:7:18)05785829014.[18](https://github.com/ten-x-dev/french-house-stack/actions/runs/7596904096/job/20691132649?pr=256#step:7:19):4331:34)
    ```

### ๐Ÿงฉ Steps to Reproduce

Import it on the server and run in CI.

### ๐Ÿค” Expected behavior

Not to break ๐Ÿ˜Š 

### ๐Ÿ˜ฎ Actual behavior

It blows up.

### ๐Ÿ’ป Code Sample

Simply create a new Remix app with ESM and import Magic on the server.

### ๐ŸŒŽ Environment

| Software           | Version(s) |
| ------------------ | ---------- |
| `@magic-sdk/admin` | 2.1.0
| Node               |  20.10.0
| `yarn`             | N/A
| Operating System   | iOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant