question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when compiling next js project after importing OpenSeaPort

See original GitHub issue

Steps to reproduce

  1. Create a brand new project with yarn create next-app, npx create-next-app@latest, or pnpm dlx create-next-app@latest
  2. Using your package manager of choice, add opensea-js
  3. Open pages/index.js
  4. Add this import import { OpenSeaPort } from "opensea-js";
  5. Save and run the project

OS: Garuda Linux x86_64 Kernel: 5.16.10-zen1-1-zen Node version: v16.13.2

Stack trace

error - ./node_modules/rustbn.js/lib/index.asm.js:1:1279
Module not found: Can't resolve 'fs'

Import trace for requested module:
./node_modules/rustbn.js/index.js
./node_modules/ethereumjs-vm/dist/evm/precompiles/06-ecadd.js
./node_modules/ethereumjs-vm/dist/evm/precompiles/index.js
./node_modules/ethereumjs-vm/dist/evm/evm.js
./node_modules/ethereumjs-vm/dist/runCode.js
./node_modules/ethereumjs-vm/dist/index.js
./node_modules/@0x/base-contract/lib/src/index.js
./node_modules/wyvern-js/lib/abi_gen/wyvern_d_a_o.js
./node_modules/wyvern-js/lib/wyvernProtocol.js
./node_modules/wyvern-js/lib/index.js
./node_modules/opensea-js/lib/seaport.js
./node_modules/opensea-js/lib/index.js

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:6
  • Comments:12

github_iconTop GitHub Comments

8reactions
esteban-OpenSeacommented, Apr 8, 2022

We are looking into this!

8reactions
zackbiernatcommented, Mar 7, 2022

Adding this to the next.config.js fixed the compile error for us

    future: {
        webpack5: true,
    },
    webpack: (config, {}) => {
        config.resolve.fallback = {
            ...config.resolve.fallback,
            fs: false,
          };
     },

but we still get a bunch of critical dependency errors in the console. Screen Shot 2022-03-07 at 4 39 23 PM

Read more comments on GitHub >

github_iconTop Results From Across the Web

module-not-found - Next.js
A module not found error can occur for many different reasons: The module you're trying to import is not installed in your dependencies;...
Read more >
Why is there an error during build next.js project?
You should give the path of images, in error says that path can't be less that 0 char. /** @type {import('next').
Read more >
How to Bypass ES Modules Errors in Next.js with Dynamic ...
When you are building an application that can be accessed on the web, there are a lot of dependencies or packages that you...
Read more >
Best practices to increase the speed for Next.js apps
Traditionally, applications load all the components and the CSS required by the application in the initial load. Dynamic import allows you to ...
Read more >
A Guide for Next.js with TypeScript - Refine Dev
With this, you can now start creating files with .ts and .tsx extensions in your application. Usage example. import React ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found