Comments (18)
I got around this by using NuxtJS's transpile feature in its config file. Depending on what framework you're using, you should have some method of transpiling modules.
from hashconnect.
Actually it works with NextJS but one has to use https://www.npmjs.com/package/next-transpile-modules
Thanks for the tip @scalemaildev !
from hashconnect.
Any news or resolution of this? I am having this issue importing anything from the package.
from hashconnect.
This can be quickfixed by renaming main.ts or main.js to main.mjs or main.mts
from hashconnect.
This issue should be labelled as breaking
from hashconnect.
How did you circumvent the issue @joelviel?
from hashconnect.
Indeed it is a blocking issue, can you fix it and make a stable release? I am trying to make a project for hedera22 hackathon.
from hashconnect.
Same issue. I can't manage to make It work. I tried basic import from documentation and it give me the error.
from hashconnect.
+1
Having same issue with NextJS. Here is error stack:
Server Error
SyntaxError: Unexpected token 'export'
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
<unknown>
file:///home/kiril/dev/metasnap/meta-web/node_modules/hashconnect/dist/main.js (1)
...
from hashconnect.
@teacoat Do we know when this issue will be resolved? We are trying to use this package on a new Svelte-Kit project but couldn't move forward because of this bug.
from hashconnect.
This can be quickfixed by renaming main.ts or main.js to main.mjs or main.mts
It looks like there is are some .mjs and .mts files in the dist already,
Can you provide a project I can reproduce this in?
from hashconnect.
Here is a sample project to reproduce the error.
https://github.com/pwoosam/hashconnect-ts-bug
After cloning, run:
npm i
npm run start
from hashconnect.
As a work around, I can clone the repo and compile as a CommonJS module by setting these fields in tsconfig.json:
"target": "ESNext",
"module": "CommonJS",
There are some additional issues that require more modification to work in a node environment (non-browser).
Such as installing polyfills for WebSocket and localstorage. Also removing references to window from the sourcecode.
from hashconnect.
@pwoosam Just tried your PR and it works great! @teacoat when will it be merged?
from hashconnect.
Seems this issue is still present as of 0.2.3
, getting the same error message.
from hashconnect.
@mrVers did you try importing the cjs library?
import { HashConnect } from 'hashconnect/dist/cjs/main';
from hashconnect.
@pwoosam No luck. I'm trying this on a React/NextJS project.
Even if I try your simple project https://github.com/pwoosam/hashconnect-ts-bug with the latest 0.2.3.
I'm seeing the same issue.
from hashconnect.
Was playing around in my old repos and discovered this problem appears to now be fixed in Nuxt3 latest.
from hashconnect.
Related Issues (20)
- any one Help me what is this issuer??? HOT 1
- Login using ECDSA key in Hashpack
- Relay can receive non-JSON messages but does not handle them gracefully
- Excessive 'Failed to parse source map' Warnings HOT 1
- lack of documentation
- Decryption error when connecting wallet. HOT 4
- Issue signing data. Approve button not working HOT 1
- Wallet Agnostic option HOT 1
- Property 'signTransaction' does not exist on type 'TransferTransaction' HOT 1
- Can't build the project because of nodejs dependencies HOT 1
- Error: Cannot find module "crypto" with Next.js 14 and Node 20.10.0 HOT 3
- TypeError: bufferUtil.mask is not a function
- The chrome extension is not injected into iframes
- HashConnect signTransaction returns wrong signature
- HashConnect signTransaction returns wrong signature
- getRecord bug : body.data was not set in the protobuf.
- Hashpack Wallet is unable to connect on mobile devices.
- Build Fails with @hashgraph/sdk and hashconnect in Next.js TypeScript Project HOT 1
- Error: No matching key. history: 1716990896575755 for AccountAllowanceApproveTransaction HOT 4
- transaction did not have exactly one node ID set
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hashconnect.