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

Build error: webpack warnings on build after upgrade to v3 #68

Open
sergkudinov opened this issue Apr 7, 2021 · 2 comments
Open

Build error: webpack warnings on build after upgrade to v3 #68

sergkudinov opened this issue Apr 7, 2021 · 2 comments

Comments

@sergkudinov
Copy link

sergkudinov commented Apr 7, 2021

After updating to "gatsby-plugin-material-ui": "^3.0.0" I've got the same issue as #65.

Installed packages:

  • browserslist: 4.16.3
  • autoprefixer: 10.2.5
  • postcss: 8.2.9
  • postcss-value-parser: 4.1.0

Error:

warn Unsafe builtin method was used, future builds will need to rebuild all pages
warn WebpackError: Unsafe builtin usage fs.existsSync
    at nikita-docs/node_modules/browserslist/node.js:38:1
    at nikita-docs/node_modules/browserslist/node.js:46:1
    at nikita-docs/node_modules/browserslist/node.js:197:1
    at nikita-docs/node_modules/browserslist/index.js:433:1
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/browsers.js:54:12
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/browsers.js:42:26
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/supports.js:41:20
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/supports.js:86:25
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/supports.js:247:29
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/supports.js:245:18
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/supports.js:270:16
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/processor.js:67:27
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/postcss/lib/container.js:138:18
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/postcss/lib/container.js:74:18
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/postcss/lib/container.js:60:16

  36 |     return filenessCache[file]
  37 |   }
> 38 |   var result = fs.existsSync(file) && fs.statSync(file).isFile()
     | ^
  39 |   if (!process.env.BROWSERSLIST_DISABLE_CACHE) {
  40 |     filenessCache[file] = result
  41 |   }

warn WebpackError: Unsafe builtin usage fs.statSync
    at nikita-docs/node_modules/browserslist/node.js:38:1
    at nikita-docs/node_modules/browserslist/node.js:46:1
    at nikita-docs/node_modules/browserslist/node.js:197:1
    at nikita-docs/node_modules/browserslist/index.js:433:1
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/browsers.js:54:12
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/browsers.js:42:26
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/supports.js:41:20
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/supports.js:86:25
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/supports.js:247:29
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/supports.js:245:18
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/supports.js:270:16
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/processor.js:67:27
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/postcss/lib/container.js:138:18
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/postcss/lib/container.js:74:18
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/postcss/lib/container.js:60:16

  36 |     return filenessCache[file]
  37 |   }
> 38 |   var result = fs.existsSync(file) && fs.statSync(file).isFile()
     | ^
  39 |   if (!process.env.BROWSERSLIST_DISABLE_CACHE) {
  40 |     filenessCache[file] = result
  41 |   }

warn WebpackError: Unsafe builtin usage fs.existsSync
    at nikita-docs/node_modules/browserslist/node.js:38:1
    at nikita-docs/node_modules/browserslist/node.js:199:1
    at nikita-docs/node_modules/browserslist/node.js:49:1
    at nikita-docs/node_modules/browserslist/node.js:197:1
    at nikita-docs/node_modules/browserslist/index.js:433:1
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/browsers.js:54:12
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/browsers.js:42:26
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/supports.js:41:20
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/supports.js:86:25
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/supports.js:247:29
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/supports.js:245:18
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/supports.js:270:16
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/autoprefixer/lib/processor.js:67:27
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/postcss/lib/container.js:138:18
    at nikita-docs/node_modules/gatsby-plugin-material-ui/node_modules/postcss/lib/container.js:74:18

  36 |     return filenessCache[file]
  37 |   }
> 38 |   var result = fs.existsSync(file) && fs.statSync(file).isFile()
     | ^
  39 |   if (!process.env.BROWSERSLIST_DISABLE_CACHE) {
  40 |     filenessCache[file] = result
  41 |   }

Environment

  System:
    OS: macOS 10.15.4
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Shell: 5.8 - /usr/local/bin/zsh
  Binaries:
    Node: 15.14.0 - /usr/local/bin/node
    Yarn: 1.22.10 - ~/.npm-global/bin/yarn
    npm: 7.5.3 - ~/.npm-global/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 89.0.4389.114
    Firefox: 87.0
    Safari: 13.1
  npmPackages:
    gatsby: ^3.2.1 => 3.2.1
    gatsby-image: ^3.2.0 => 3.2.0
    gatsby-plugin-catch-links: ^3.2.0 => 3.2.0
    gatsby-plugin-emotion: ^6.2.0 => 6.2.0
    gatsby-plugin-google-analytics: ^3.2.0 => 3.2.0
    gatsby-plugin-manifest: ^3.2.0 => 3.2.0
    gatsby-plugin-material-ui: ^3.0.0 => 3.0.0
    gatsby-plugin-mdx: ^2.2.0 => 2.2.0
    gatsby-plugin-offline: ^4.2.0 => 4.2.0
    gatsby-plugin-react-helmet: ^4.2.0 => 4.2.0
    gatsby-plugin-robots-txt: ^1.5.5 => 1.5.5
    gatsby-plugin-sitemap: ^3.2.0 => 3.2.0
    gatsby-remark-autolink-headers: ^3.2.0 => 3.2.0
    gatsby-remark-prismjs: ^4.2.0 => 4.2.0
    gatsby-remark-title-to-frontmatter: ^1.1.2 => 1.1.2
    gatsby-source-filesystem: ^3.2.0 => 3.2.0
  npmGlobalPackages:
    gatsby: 3.2.1
@sergkudinov sergkudinov changed the title Bug: webpack warnings on build after upgrade to v3 Build error: webpack warnings on build after upgrade to v3 Apr 7, 2021
@patspam
Copy link

patspam commented Jun 10, 2021

Any updates here? Disabling autoprefixing isn't ideal..

@jkananen
Copy link

For those following this issue, have a look at the latest comments at #65 (comment)

In our case, Mui's Accordion component was the culprit, and using our own implementation instead helped removing the last warnings related to this.

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

3 participants