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

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

Open
jer-sen opened this issue May 25, 2023 · 2 comments
Open

Comments

@jer-sen
Copy link

jer-sen commented May 25, 2023

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

@SpBills
Copy link

SpBills commented Jun 30, 2023

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

@jer-sen
Copy link
Author

jer-sen commented Jul 2, 2023

No, I'm not using Next.

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

2 participants