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

[BUG] Use ES6 syntax to import buffer #1784

Open
cguillemette opened this issue Oct 3, 2023 · 2 comments
Open

[BUG] Use ES6 syntax to import buffer #1784

cguillemette opened this issue Oct 3, 2023 · 2 comments

Comments

@cguillemette
Copy link

cguillemette commented Oct 3, 2023

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @onflow/[email protected] for the project I'm working on.

Otherwise, I get an error trying to load this package using esm and it doesn't play well. Note the fix just uses ES6 syntax just like /rlp import. If you agree I can create a PR.

image

Here is the diff that solved my problem:

diff --git a/node_modules/@onflow/fcl/dist/fcl.module.js b/node_modules/@onflow/fcl/dist/fcl.module.js
index 2781ac6..0a9f1e6 100644
--- a/node_modules/@onflow/fcl/dist/fcl.module.js
+++ b/node_modules/@onflow/fcl/dist/fcl.module.js
@@ -13,7 +13,7 @@ import { subscriber, snapshoter, send, spawn, INIT, SUBSCRIBE, UNSUBSCRIBE, UPDA
 import * as rlp from '@onflow/rlp';
 import { Buffer, encode } from '@onflow/rlp';
 import { uid } from '@onflow/util-uid';
-import require$$0 from 'buffer';
+import * as require$$0 from 'buffer';
 export { template as cadence, template as cdc } from '@onflow/util-template';
 
 async function getChainIdFromAccessNode() {

This issue body was partially generated by patch-package.

@cguillemette cguillemette changed the title Use ES6 syntax to import buffer [BUG] Use ES6 syntax to import buffer Oct 3, 2023
@jribbink
Copy link
Contributor

jribbink commented Oct 3, 2023

Yeah this change seems acceptable to me. It shouldn't break any existing functionality so I personally don't have any real concerns.

@cguillemette
Copy link
Author

Thanks @jribbink, once I get a minute I'll create a 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

No branches or pull requests

2 participants