1

I am using wallet adapter with gemworks' gemfarm site. Everything works correctly in development, but open building my is givng error of "'{ children: Element[]; }'". I read that it was an error with React 18, but gemworks package file calls for 18 and walletadapter doesn't even include it in their package. If you have any suggestions to fix this it would be much appreciated as that' is the only error keeping it from building and deploying!

EDIT: _app.tsx

IMPORTS
config.autoAddCss = false;

const WalletProvider = dynamic(
  () => import("../Components/WalletProvider/WalletProvider"),
  {
    ssr: false,
  }
);

function App(props: AppProps) {
  const { Component, Props } = props;

  // const [colorMode, setColorMode] = useColorMode()

  return (
    <>
      {/* <ThemeProvider theme={defaultTheme}> */}
      
      <WalletProvider>
        <Appbar/>
        <Component {...Props} />
        <Footer/>
      </WalletProvider>
      {/* </ThemeProvider> */}
    </>
  );
}

export default withGA(process.env.NEXT_PUBLIC_GA_ID, Router)(App);

Stacktrace:


  70 |       </Head>
  71 |
> 72 |       <WalletProvider>
     |        ^
  73 |         <Appbar/>
  74 |         <Component {...Props} />
  75 |         <Footer/>

> Build error occurred
Error: Call retries were exceeded
    at ChildProcessWorker.initialize (C:\Users\josht\TF_website\node_modules\next\dist\compiled\jest-worker\index.js:1:11661)
    at ChildProcessWorker._onExit (C:\Users\josht\TF_website\node_modules\next\dist\compiled\jest-worker\index.js:1:12599)
    at ChildProcess.emit (node:events:527:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) {
  type: 'WorkerError'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.```
4
  • 2
    Please provide a paste of your full stacktrace, and a snippet of your code that the error relates to. It helps with troubleshooting
    – cloudberry
    Commented Aug 9, 2022 at 7:07
  • its more like a react error than solana
    – kafinsalim
    Commented Aug 9, 2022 at 9:09
  • @kafinsalim Ah okay, figured since they put the newest react in the packages it wouldn't be the problem. I'll ask on the react pages for a workaround.
    – Joshua
    Commented Aug 9, 2022 at 14:13
  • Without seeing the source of ../Components/WalletProvider/WalletProvider, which is what seems to be throwing the error, it's difficult to tell what's wrong here.
    – Jordan
    Commented Aug 10, 2022 at 23:06

1 Answer 1

2

After doing some research, it seems it is a error in react as @kafinsalim stated, I dont know if this is a good workaround but to solve the issue and create a build while keeping everything working correctly. You must change the following in WalletProvider.tsx Line 27 const Wallet: React.FC = ({ children }: { children: React.ReactElement }) => to const Wallet = (props: ContainerProps) => { and line 65 {children} to {props.children}

This solves the problem, and lets the program build for production.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.