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

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

Open
ducmint864 opened this issue Sep 19, 2023 · 2 comments
Open

Comments

@ducmint864
Copy link

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>
    )
}
  1. 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 (
    <html lang="en">
      {/* <Header /> */}
      <body className={inter.className}>{children}</body>
    </html>
  )
}
  1. Run command npm run build
@mjafri118
Copy link

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

@ducmint864
Copy link
Author

@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.

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