Next.js Discord

Discord Forum

Loader webpack for sequelize

Unanswered
Huyenlong posted this in #help-forum
Open in Discord
Hi

i search how to configure the loader module because when i use sequelize like a GET route, i have this bug :

You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file


i have this in next.config
const nextConfig = {
  webpack: (config, { isServer, defaultLoaders, pluginOptions }) => {
      config.ignoreWarnings = [
        { module: /node_modules\/node-fetch\/lib\/index\.js/ },
        { file: /node_modules\/node-fetch\/lib\/index\.js/ },
      ];
      if (isServer) {
        console.log("this is webpack")
          config.resolve.fallback = {
              "@sequelize/mariadb": false,
              "@sequelize/mssql": false,
              "@sequelize/mysql": false,
              
              // "@sequelize/postgres": true,
              "@sequelize/sqlite3": false,
              "@sequelize/db2-ibmi": false,
              "@sequelize/db2": false,
              "@sequelize/snowflake": false,
              "@mapbox": false,
              "@sequelize":false
          };
      }
      return config;
  },
};


Thanks for help

0 Replies