braid-ui 1.0.69 → 1.0.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -320,6 +320,33 @@ function App() {
320
320
 
321
321
  Braid UI is built with TypeScript and includes type definitions. No additional `@types` packages are required.
322
322
 
323
+ ## Next.js Configuration
324
+
325
+ If you're using Braid UI in a Next.js application and need to use components that include PDF viewing (like `BusinessDetailView` with `BusinessDocuments`), you'll need to configure Next.js webpack to handle `react-pdf` dependencies correctly.
326
+
327
+ Add the following to your `next.config.js`:
328
+
329
+ ```js
330
+ const nextConfig = {
331
+ webpack: (config, { isServer }) => {
332
+ // Fix for react-pdf/pdfjs-dist in Next.js
333
+ if (!isServer) {
334
+ config.resolve.alias = {
335
+ ...config.resolve.alias,
336
+ canvas: false,
337
+ }
338
+ }
339
+ return config
340
+ },
341
+ }
342
+
343
+ module.exports = nextConfig
344
+ ```
345
+
346
+ This prevents Next.js from trying to bundle Node.js-specific dependencies that `pdfjs-dist` might reference during webpack analysis.
347
+
348
+ **Note**: If you're not using any PDF-related components, this configuration is optional.
349
+
323
350
  ## License
324
351
 
325
352
  MIT