ceramicnetwork / ceramicnetwork/js-ceramic

Cannot call a class as a function

Open
#1,311 8 comments 0 reactions 1 assignee Claimed by @zachferland View on GitHub
bug dependencies
Dominant language
TypeScript
Stars
423
Forks
126
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Cannot call a class as a function while using webpack in production

**To Reproduce**
Steps to reproduce the behavior:
1. Setup a react-app-rewired project.
2. Attempt to create a 3box ID as seen in the below screenshot.
3. Create a build production using `npm run build`. (Make sure to use production build not webpack dev server, dev server is unaffected)
4. Open the production build in your web browser of choice, open up the page at `#/links` in browser
5. Follow from step 2 below.

Optionally you can use the publicly available react example:

Steps:
1. Open up the webpage [here](https://bafybeihi56eyjxvym77zdqfwwwxkzysj2y44v2dtqqrn2lcfjuencpbftq.ipfs.dweb.link/#/links)
2. Hit the sign in button
3. Scan the QR code in an ethereum wallet such as ImToken. (Open console after this step)
4. Go through the signing prompts on the app
5. View error in console

**Expected behavior**
No error should be present.

**Screenshots**
![err1](https://user-images.githubusercontent.com/47548474/115623400-ffd31e80-a2ad-11eb-95e4-a47857ed7b3a.PNG)
![code1](https://user-images.githubusercontent.com/47548474/115624396-6d337f00-a2af-11eb-91ff-3ef202421a0f.PNG)
The issue being triggered somewhere inside of the login code above, but due to webpack finding the actual line is tricky.. Will update this issue when I can isolate the exact line of code which is causing this issue

**Ceramic versions**

```
"@ceramicnetwork/http-client": "^0.10.2"
"@ceramicnetwork/doctype-tile": "^0.14.1"
"@ceramicstudio/idx-constants"
```

**Additional context**
This issue is not present when using the dev server for webpack/react
Using react-app-rewired
Similar to https://github.com/ceramicnetwork/js-ceramic/issues/1251

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.