solana-foundation / solana-com

The solana.com website.
https://solana.com/
GNU General Public License v3.0
41 stars 13 forks source link

Remove alias config causing all Nextjs App directory paths to error #8

Closed ZYJLiu closed 2 months ago

ZYJLiu commented 2 months ago

Alias results in nextjs app dir paths to throw TypeError: Cannot read properties of null (reading 'useContext') CleanShot 2024-08-02 at 13 26 33@2x

Removing following code from next.config.js fixes issue

      // Alias configuration
      config.resolve.alias = {
        ...config.resolve.alias,
        react: path.resolve(__dirname, "node_modules/react"),
      };

CleanShot 2024-08-02 at 13 27 39@2x

Code was added in this PR. Solana-com seems to run fine with it removed.

vercel[bot] commented 2 months ago

@ZYJLiu is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
solana-next-com ✅ Ready (Inspect) Visit Preview Aug 4, 2024 4:57pm
ZYJLiu commented 2 months ago

Open to suggestions here, maybe this alias should be removed indeed and only temp added when someone is working with solana-lib locally? Or is there a better way to handle this?

Can it be a conditional config based on a .env variable?

catalinred commented 2 months ago

Open to suggestions here, maybe this alias should be removed indeed and only temp added when someone is working with solana-lib locally? Or is there a better way to handle this?

Can it be a conditional config based on a .env variable?

I don't think we have an .env variable to be specific for linking projects and to be used in this case but let me know if you have something in mind .

On removing the alias config, the part where the path is required should be also removed.