Skip to content

Node's types should not be imported for module to be used in browser #478

Open

Description

@jer-sen

/// <reference types="node" /> should be removed from d.ts, removing @types/node dependency should solve the issue.

Activity

  1. SpBills commented on Jun 30, 2023

    @SpBills

    Are you using Next? If you don't explictly use any of the file function stuff, then check out using this as your next.config.js:

    /** @type {import('next').NextConfig} */
    const nextConfig = {
      ...
      webpack(config) {
        config.resolve.fallback = {
          ...config.resolve.fallback, // if you miss it, all the other options in fallback, specified
            // by next.js will be dropped. Doesn't make much sense, but how it is
          fs: false, // the solution
        }
    
        return config
      }
    }
    
    module.exports = nextConfig
  2. jer-sen commented on Jul 2, 2023

    @jer-sen
    Author

    No, I'm not using Next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions