Module not found: Can’t resolve ‘pino-pretty’

module-not-found:-can’t-resolve-‘pino-pretty’

Here’s a simple way to fix the “Module not found: Can’t resolve ‘pino-pretty'” and “Module not found: Can’t resolve ‘encoding'” errors in your NextJS or ReactJS project:

  1. Open your next.config.js file in the root folder of your project.
  2. Add this line config.externals.push(‘pino-pretty’, ‘encoding’);
/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  webpack: (config) => {
    config.resolve.fallback = { fs: false, net: false, tls: false };
    config.externals.push('pino-pretty', 'encoding');
    return config;
  },
};

module.exports = nextConfig;

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
crud-laravel-10-dan-bootstrap-5-#5:-menghapus-data

CRUD Laravel 10 dan Bootstrap 5 #5: Menghapus Data

Next Post
how-to-create-an-email-list-and-use-it-for-seo

How to Create an Email List and Use It for SEO

Related Posts