Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NextJS Error. Module not found #27

Open
syedzayyan opened this issue Jan 7, 2024 · 0 comments
Open

NextJS Error. Module not found #27

syedzayyan opened this issue Jan 7, 2024 · 0 comments

Comments

@syedzayyan
Copy link

Hello, I am trying to use Pyodide with my NextJS application, and using this plugin.

This is why next.config.js

const CopyPlugin = require("copy-webpack-plugin");
const { PyodidePlugin } = require("@pyodide/webpack-plugin");

const nextConfig = {
  webpack(config, { isServer }) {
    config.plugins.push(
      new CopyPlugin({
        patterns: [
          {
            from: "node_modules/@rdkit/rdkit/dist/RDKit_minimal.wasm",
            to: "static/chunks"
          }
        ]
      })
    );

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

    return config;
  },   
  plugins: [new PyodidePlugin()],
  output: "export",
  basePath: "/sar-in-browser",
  images: {
    unoptimized: true,
  },
};

module.exports = nextConfig;

And this is how I am trying to load pyodide:

let pyodide = await loadPyodide({
    indexURL: { indexURL: `${window.location.origin}/pyodide` },
});

Any help would be lovely!

@syedzayyan syedzayyan changed the title NextJS Error. Module not founded NextJS Error. Module not found Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant