Skip to content

ardisaurus/next-js-argon2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

next-js-argon2

Argon 2 implementation in NextJS

Dependencies

Webpack config override

This webpack config override supposed to fix Failed to parse source map: TypeError: Cannot read property 'start' of undefined argon2-browser error.

  1. Create next.config.js file.
  2. Insert this codes in next.config.js.
module.exports = {
  webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
    config.module.rules.push({
      test: /\.wasm$/,
      loader: "base64-loader",
      type: "javascript/auto",
    });

    config.module.noParse = /\.wasm$/;

    config.module.rules.forEach((rule) => {
      (rule.oneOf || []).forEach((oneOf) => {
        if (oneOf.loader && oneOf.loader.indexOf("file-loader") >= 0) {
          oneOf.exclude.push(/\.wasm$/);
        }
      });
    });

    if (!isServer) {
      config.resolve.fallback.fs = false;
    }

    // Perform customizations to webpack config
    config.plugins.push(
      new webpack.IgnorePlugin({ resourceRegExp: /\/__tests__\// })
    );

    // Important: return the modified config
    return config;
  },
};
  1. Run with yarn dev

About

Argon 2 implementation in NextJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published