Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions app/components/TransferForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ export const TransferForm: React.FC<{
const { token, amount, recipientNetwork, recipientNetworkImageUrl } = watch();

// Get the Network object for the selected recipient network
const transferNetwork =
networks.find((n) => n.chain.name === recipientNetwork) || selectedNetwork;
const transferNetwork = networks.find(n => n.chain.name === recipientNetwork) || selectedNetwork;

const fetchedTokens: Token[] = allTokens[transferNetwork.chain.name] || [];
const tokens = fetchedTokens.map((token) => ({
Expand All @@ -94,7 +93,9 @@ export const TransferForm: React.FC<{
const recipientNetworks = networks
.filter((network) => {
if (useInjectedWallet) return true;
return network.chain.name !== "Celo";
return (
network.chain.name !== "Celo"
);
})
.map((network) => ({
name: network.chain.name,
Expand Down
2 changes: 1 addition & 1 deletion app/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ export const serverConfig = {
dataset: process.env.SANITY_STUDIO_DATASET || "",
apiVersion: "2024-01-01", // Pin to a stable date
useCdn: false, // Set to false for fresh data
};
};
2 changes: 1 addition & 1 deletion app/lib/sanity-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ export async function getCategories(): Promise<SanityCategory[]> {
next: { revalidate: 300 },
},
);
}
}
7 changes: 0 additions & 7 deletions instrumentation-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,9 @@ Sentry.init({
environment: config.nodeEnv,
release: "2.0.0",

integrations: [
Sentry.replayIntegration(),
],

tracesSampleRate: config.nodeEnv === 'production' ? 0.1 : 1.0,

enableLogs: true,
replaysSessionSampleRate: 0.1,

replaysOnErrorSampleRate: 1.0,

sendDefaultPii: false,

Expand Down
33 changes: 25 additions & 8 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { withSentryConfig } from "@sentry/nextjs";

/** @type {import('next').NextConfig} */
const nextConfig = {
headers: async () => [
Expand Down Expand Up @@ -54,7 +55,7 @@ const nextConfig = {
optimizePackageImports: ["@headlessui/react", "framer-motion"],
},
serverExternalPackages: ["mixpanel", "https-proxy-agent", "rate-limiter-flexible"],
webpack: (config, { isServer }) => {
webpack: (config, { webpack, isServer }) => {
// Handle both client and server-side fallbacks
config.resolve.fallback = {
...config.resolve.fallback,
Expand All @@ -73,12 +74,28 @@ const nextConfig = {
os: false,
};

// Exclude TypeScript definition files from being processed
if (!config.plugins) {
config.plugins = [];
}
config.plugins.push(
new webpack.IgnorePlugin({
resourceRegExp: /\.d\.ts$/,
})
);
Comment on lines +77 to +85
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Document what specific build error this .d.ts IgnorePlugin solves.

TypeScript loaders generate .d.ts files that should be ignored in watch mode to prevent infinite watch loops, but blanket ignoring all .d.ts files in the webpack config is unusual. This IgnorePlugin will prevent legitimate TypeScript definition imports from being processed. Please add a comment explaining:

  • What specific build error this was added to fix
  • Which dependency triggered the issue
  • Whether the root cause could be better addressed (e.g., through package resolution or reporting upstream)

Without this context, the fix appears to be masking a deeper configuration problem rather than solving the underlying issue.

🤖 Prompt for AI Agents
In next.config.mjs around lines 82 to 90, the IgnorePlugin that skips all
`.d.ts` files needs a clear comment and a safer scope: document the exact build
error it fixes (e.g., "infinite watch-loop or EMFILE/file-watcher errors caused
by <dependency-name> generating .d.ts during build"), name the dependency that
triggered the issue, and note whether this is a workaround vs. a root-cause fix;
then narrow the IgnorePlugin to only the offending paths or apply it only in
watch mode (or prefer fixing package resolution/upstream) and add the
explanatory comment describing the specific error, dependency, and recommended
long-term remediation.


// Handle Mixpanel on server-side only
if (isServer) {
config.externals = config.externals || [];
config.externals.push({
mixpanel: "commonjs mixpanel",
});
} else {
config.resolve.alias = {
...config.resolve.alias,
'@solana-program/token': false,
'@solana-program/system': false,
};
}

return config;
Expand Down Expand Up @@ -106,12 +123,12 @@ const nextConfig = {
},
...(process.env.NODE_ENV !== "production"
? [
{
protocol: "https",
hostname: "picsum.photos",
pathname: "/**",
},
]
{
protocol: "https",
hostname: "picsum.photos",
pathname: "/**",
},
]
: []),
],
},
Expand Down Expand Up @@ -150,4 +167,4 @@ export default withSentryConfig(nextConfig, {
disableLogger: true,

automaticVercelMonitors: true,
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"@types/react-dom": "^19.0.3",
"react": "^19.0.1",
"react-dom": "^19.0.1",
"@solana/kit": "^3.0.3"
"@solana/kit": "^5.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check package.json for @solana/kit and pnpm overrides
echo "=== Checking package.json around line 116 for @solana/kit ==="
sed -n '100,130p' package.json

echo -e "\n=== Checking for pnpm overrides section in package.json ==="
cat package.json | grep -A 20 "\"pnpm\""

echo -e "\n=== Checking next.config.mjs for Solana packages ==="
cat next.config.mjs | grep -i "solana" -B 3 -A 3

echo -e "\n=== Searching for @solana/kit imports in TypeScript/JavaScript files ==="
find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) ! -path "*/node_modules/*" ! -path "*/.next/*" -exec grep -l "@solana/kit" {} \; | head -20

Repository: paycrest/noblocks

Length of output: 1906


Remove the @solana/kit override or update to a valid version.

The pnpm override for @solana/kit": "^5.0.0" specifies a non-existent package version and is not used anywhere in the codebase. Either remove it if @solana/kit usage is not planned, or update to a valid version (current latest is 3.0.3) if it will be integrated. The related next.config.mjs excludes @solana-program/* packages, not @solana/kit, suggesting this override may have been added in error.

🤖 Prompt for AI Agents
In package.json around line 116, the pnpm override entry "@solana/kit": "^5.0.0"
references a non-existent version; either delete this override if @solana/kit is
not used, or replace it with a valid released version (e.g. "3.0.3") and run
pnpm install to update the lockfile; ensure any change is reflected in
package.json's pnpm.overrides block and remove any stray exclusions for
unrelated packages in next.config.mjs if this override was added by mistake.

}
},
"browser": {
Expand Down
Loading
Loading