torusresearch / eccrypto

Creative Commons Zero v1.0 Universal
9 stars 6 forks source link

Next.Js app can't compile because of @toruslab/eccrypto syntax error #37

Open ducmint864 opened 1 year ago

ducmint864 commented 1 year ago

Description

Hi, I'm writing a simple NextJs program that use the lib 'react-moralis', and apparently, 'react-moralis' also utilizes @toruslab/eccrypto lib. When I compile my project with 'npm run build', it shows the syntax error related to @toruslab/eccrypto as following:

image

Context

  1. NodeJs version: 18.16
  2. Os: Ubuntu 22.04 (WSL)

How to recreate the error

  1. Init NextJs project: npx create-next-app@latest
  2. Edit the content /app/page.tsx as follow:
    import { useMoralis, useWeb3Contract } from 'react-moralis';
    export default function Home() {
    const { enableWeb3, isWeb3Enabled } = useMoralis();
    return (
        <h1>Hi</h1>
    )
    }
  3. Edit the content of /app/layout.tsx as follow:
    
    import './globals.css'
    import type { Metadata } from 'next'
    import { Inter } from 'next/font/google'

const inter = Inter({ subsets: ['latin'] })

export const metadata: Metadata = { title: 'Create Next App', description: 'Generated by create next app', }

export default function RootLayout({ children, }: { children: React.ReactNode }) { return (

{/*
*/} {children}

) }


4. Run command ``npm run build``
mjafri118 commented 10 months ago

@ducmint864 have you found a fix to get going with this?

ducmint864 commented 10 months ago

@mjafri118 Unfortunately no, I still don't know how to fix it til this day. I'm just a student so if this package doesn't work, Imma just move on. If you're having the same problem as I did, hope you find a solution for yourself.