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

Fix ecpair lib error with babel plugin #642

Closed
wants to merge 1 commit into from

Conversation

michalsmiarowski
Copy link
Contributor

@michalsmiarowski michalsmiarowski commented Oct 5, 2023

After updating the tbtc-v2.ts lib with new version for goerli, we've ecnoutered a problem running dApp:

Failed to compile.

./node_modules/ecpair/src/ecpair.js 82:7
Module parse failed: Unexpected token (82:7)
File was processed with these loaders:
 * ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|
|   class ECPair {
>     __D;
|     __Q;
|     compressed;

As you an see it is related to the ecpair lib that we've installed in tbtc-v2.ts (see keep-network/tbtc-v2#700) and it has something to do with our webpack. As a solution I've installed a babel plugin - @babel/plugin-transform-class-properties - and added it to the craco config with the loose option.

You can see more information about this plugin in the babel docs: https://babeljs.io/docs/babel-plugin-transform-class-properties.

After updating the `tbtc-v2.ts` lib with new version for `goerli`, we've
ecnoutered a problem running dApp:

```
Failed to compile.

./node_modules/ecpair/src/ecpair.js 82:7
Module parse failed: Unexpected token (82:7)
File was processed with these loaders:
 * ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|
|   class ECPair {
>     __D;
|     __Q;
|     compressed;
```

As you an see it is related to the `ecpair` lib that we've installed in
`tbtc-v2.ts` and it has something to do with our `webpack`. As a solution I've
installed a babel plugin - `@babel/plugin-transform-class-properties` - and
added it to the craco config with the `loose` option.

You can see more information about this plugin in the babel docs:
https://babeljs.io/docs/babel-plugin-transform-class-properties.
@michalsmiarowski michalsmiarowski self-assigned this Oct 5, 2023
@michalsmiarowski michalsmiarowski added this to the v1.12.0 milestone Oct 5, 2023
@github-actions
Copy link

github-actions bot commented Oct 5, 2023

@michalsmiarowski michalsmiarowski marked this pull request as draft October 5, 2023 13:01
@michalsmiarowski
Copy link
Contributor Author

This issue will be resolve in #652 (see 890b3e0). Closing this PR...

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

Successfully merging this pull request may close these issues.

1 participant