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

upgrade breaks redoc from 2.0.0-rc.48 to 2.0.0-rc.51 #1575

Closed
biantris opened this issue Apr 9, 2021 · 10 comments
Closed

upgrade breaks redoc from 2.0.0-rc.48 to 2.0.0-rc.51 #1575

biantris opened this issue Apr 9, 2021 · 10 comments

Comments

@biantris
Copy link

biantris commented Apr 9, 2021

My site with docusaurus version 2.0.0-alpha.72 breaks with this update:

Failed to compile

/home/beatriz/projects/feedback/feedback-front/node_modules/@redocly/openapi-core/lib/resolve.js
Module not found: Can't resolve 'fs' in '/home/beatriz/projects/feedback/feedback-front/node_modules/@redocly/openapi-core/lib'
@andriyl
Copy link
Contributor

andriyl commented Apr 12, 2021

@beatrizoliveiira added fix, version: 2.0.0-rc.53 (latest).
Could you confirm, please?

@mfaux
Copy link

mfaux commented Jun 9, 2021

I'm also using docusaurus (2.0.0-beta.0) and get similar errors with redoc 2.0.0-rc.54:

Module not found: Error: Can't resolve 'fs' in 'C:\git\myrepo\doc\node_modules\redoc\bundles'
Module not found: Error: Can't resolve 'process/browser' in 'C:\git\myrepo\doc\node_modules\yaml\browser\dist'

@tm1000
Copy link

tm1000 commented Jun 9, 2021

This is still an issue in 54 when using webpack 5

@RomanHotsiy
Copy link
Member

Must be related to webpack 5 specifics. We'll try to check this. Any help would be appreciated.

It works at least with create react app.

@MihaiSandor
Copy link

MihaiSandor commented Jun 10, 2021

This is still an issue in react-static

@tm1000
Copy link

tm1000 commented Jun 11, 2021

@RomanHotsiy Its something in webpack 5 yes as its an issue when Im using NextJS specifically

Can this be reopened or maybe we can create a better ticket for tracking

@CodeFarmer
Copy link

CodeFarmer commented Jul 27, 2021

Can confirm this is a problem with recent Gatsby as well (Webpack 5). rc.55 still broken, can't roll back to .48 because it's gone?

EDIT: current workaround in webpack config

    resolve: {     
      fallback: {
        "fs": false
      }
    }

@RomanHotsiy
Copy link
Member

Webpack 5 issue here: #1584

@useafterfree
Copy link

Can confirm this is a problem with recent Gatsby as well (Webpack 5). rc.55 still broken, can't roll back to .48 because it's gone?

EDIT: current workaround in webpack config

    resolve: {     
      fallback: {
        "fs": false
      }
    }

This also fixes Next.js (in next.config.js):

  webpack: (config, { isServer }) => {
    // Fixes npm packages that depend on `fs` module
    if (!isServer) {
      // config.node = { fs: 'empty' };
      config.resolve.fallback.fs = false;
    }

    return config
  }

@glintik
Copy link

glintik commented Oct 8, 2021

BTW, for all who are still using Webpack 4(like me):

node: {
    fs: 'empty',
},

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

9 participants