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

Webpack error #98123 when running "gatsby develop" #17557

Closed
coldPen opened this issue Sep 11, 2019 · 47 comments
Closed

Webpack error #98123 when running "gatsby develop" #17557

coldPen opened this issue Sep 11, 2019 · 47 comments
Labels
type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@coldPen
Copy link

coldPen commented Sep 11, 2019

Description

gatsby develop doesn't work because of an error #98123 from Webpack.

Steps to reproduce

  1. Clone my repo
  2. cd into that repo
  3. Run npm install
  4. Run gatsby develop

Expected result

Development server should start

Actual result

I get this output:

ERROR #98123  WEBPACK
Generating SSR bundle failed
[BABEL] /home/fw33n/ateliers-chartreux/.cache/develop-static-entry.js: Cannot find module '@babel/helper-create-class-features-plugin' (While processing: "/home/fw33n/ateliers-chartreux/node_modules/@babel/plugin-proposal-class-properties/lib/index.js")
File: .cache/develop-static-entry.js
⠼ start webpack server

Environment

gatsby info --clipboard (I'm running Ubuntu in WSL):

System:
  OS: Linux 4.4 Ubuntu 18.04.2 LTS (Bionic Beaver)
  CPU: (8) x64 Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
  Shell: 4.4.19 - /bin/bash
Binaries:
  Node: 10.16.3 - ~/.nvm/versions/node/v10.16.3/bin/node
  npm: 6.11.3 - ~/.nvm/versions/node/v10.16.3/bin/npm
Languages:
  Python: 2.7.15+ - /usr/bin/python
npmPackages:
  gatsby: ^2.15.9 => 2.15.9
  gatsby-plugin-sass: ^2.1.13 => 2.1.13
  gatsby-source-contentful: ^2.1.33 => 2.1.33
npmGlobalPackages:
  gatsby-cli: 2.7.47

Additionnally, my package.json:

{
  "name": "ateliers-chartreux",
  "private": true,
  "description": "Le site des Ateliers Chartreux",
  "version": "0.1.0",
  "license": "MIT",
  "scripts": {
    "build": "gatsby build",
    "develop": "gatsby develop",
    "format": "prettier --write \"**/*.{js,jsx,json,md}\"",
    "start": "npm run develop",
    "serve": "gatsby serve",
    "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing \""
  },
  "dependencies": {
    "gatsby": "^2.15.9",
    "gatsby-plugin-sass": "^2.1.13",
    "gatsby-source-contentful": "^2.1.33",
    "node-sass": "^4.12.0",
    "react": "^16.9.0",
    "react-dom": "^16.9.0"
  },
  "devDependencies": {
    "prettier": "^1.18.2"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/gatsbyjs/gatsby-starter-hello-world"
  },
  "bugs": {
    "url": "https://github.com/gatsbyjs/gatsby/issues"
  }
}

@jonniebigodes jonniebigodes added the type: question or discussion Issue discussing or asking a question about Gatsby label Sep 11, 2019
@jonniebigodes
Copy link

@coldPen sorry that you're experiencing errors with gatsby, but based on the description itself it's a bit difficult to triage. Also you forgot to link the repo.

@coldPen
Copy link
Author

coldPen commented Sep 13, 2019

Thank you @jonniebigodes , here's the repo although I'm not sure this has anything to do with the project itself, I can run develop and build on my Linux computer, this seems specific to WSL?

@jonniebigodes
Copy link

@coldPen cloning it to my wsl machine and going to take a look at what could be the issue.

@jonniebigodes
Copy link

jonniebigodes commented Sep 14, 2019

@coldPen i've been testing this today and this one is kinda tricky to triage. Here are the steps i took.

  • Cloned the repo into my ubuntu wsl "machine". I'm running Ubuntu 18.04 LTS
  • Here's the result of gatsby info in Ubuntu.
    cold_pen_wsl_1
  • Installed the dependencies and issued sudo yarn develop, since i've not configured yarn/npm i've got to run it with elevated privileges and i'm presented with the following:
    cold_pen_wsl_2

The errors thrown are based on the fact that i confugured a space for issues regarding gatsby and contenful and when the plugin tries to fetch the data based on your query it will fail.

I would like for you to do a couple of steps to see if you can get it to run in wsl.

  • Remove package-lock.json and/or yarn.lock
  • Issue gatsby clean to purge any stale data.
  • Remove node_modules folder.
  • Install the dependencies again with your package manager of choice, either npm or yarn.
  • Issue gatsby develop and see if the error does not pop back.

These because if memory serves me right it could be some issue with a package.

Feel free to provide feedback so that we can close this issue or continue to work on it until we find a suitable solution.

@coldPen
Copy link
Author

coldPen commented Sep 15, 2019

Thank you for paying close attention to this! I'll get back to you as soon as I get back on this computer.

@shicholas
Copy link
Contributor

I am seeing this error too. My code works fine on my mac, but fails in CI, which uses Ubuntu (https://circleci.com/gh/1337lawyers/web/360)

@shicholas
Copy link
Contributor

I solved my issue by adding python to my environment - perhaps it's the same issue you're having @coldPen ?

@coldPen
Copy link
Author

coldPen commented Sep 16, 2019

@shicholas Python: 2.7.15+ - /usr/bin/python was displayed when I ran gatsby info, so I don't know? Maybe gatsby can't find python even if installed.

@jonniebigodes
Copy link

@shicholas locally on ubuntu 18.04 it comes with python 2.7+ if not mistaken.

@shicholas
Copy link
Contributor

hmm, it's probably not it then. fwiw, I have Python 3.8 installed.

@shaneiadt
Copy link

I'm getting the same issue when attempting to run gatsby develop.

System:
    OS: Windows 10
    CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
  Binaries:
    Yarn: 1.17.3 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
  Languages:
    Python: 2.7.15
  Browsers:
    Edge: 44.18362.329.0
  npmPackages:
    gatsby: ^2.15.18 => 2.15.18
    gatsby-image: ^2.2.19 => 2.2.19
    gatsby-plugin-manifest: ^2.2.17 => 2.2.17
    gatsby-plugin-offline: ^3.0.7 => 3.0.7
    gatsby-plugin-react-helmet: ^3.1.7 => 3.1.7
    gatsby-plugin-sharp: ^2.2.24 => 2.2.24
    gatsby-source-filesystem: ^2.1.24 => 2.1.24
    gatsby-transformer-sharp: ^2.2.15 => 2.2.15

I've tried gatsby clean & re-installed all npm packages but no joy :(

Any help would be great, not quite sure were to go from here.

@shaneiadt
Copy link

I've also updated to Python: 3.7.4 but still not working....dang!

@shaneiadt
Copy link

I tried moving the project folder to another directory as I had a special character in the folder path & everything works fine now 👍

Maybe check your folder structure doesn't have any special characters. @coldPen

@coldPen
Copy link
Author

coldPen commented Sep 19, 2019

@shaneiadt thank you, but that isn't the case (repo is named ateliers-chartreux, is - considered a special character? )
@jonniebigodes I followed your instructions and nothing changed. I then reinstalled the Ubuntu subsystem and it's working again, fingers crossed!

@jonniebigodes
Copy link

@shaneiadt special characters would be for instance à,ç,é,â or ã, these being particular to the portuguese language, if it had used any of those for filenames and/or on path it would probably break the build.

I considered that the use of characters could be the case in the last test that i did, because one special character of those listed above is being used in a query, but i confirmed that was not the case by modifying the query in the appropriate file to my contentful space and it returned the data correctly.

Also when i test a issue that pops in here, i usually use the following nomenclature for testing, create a gatsby site called test-nameofauthorofissue and it works fine with either windows 10 or linux in vm or wsl.

@coldPen on one side i'm happy that it's working, but on the other side having to reinstall the wsl is something that is not actually productive if the issue persists.

@coldPen
Copy link
Author

coldPen commented Sep 27, 2019

@jonniebigodes I feel this problem is largely beyond my understanding, furthermore this only concerned a work environment which I only use secondarily. I'm sorry but I need to make this repo private since I have to commit my environment variables file to start deploying it. Won't close the issue though, if you think it's still relevant?

@jonniebigodes
Copy link

@coldPen it could be some variable we're both missing, probably due to some permissions or something like that,go ahead and make the repo private and continue your work. I'll leave it you to if you want this open or not. If you want to close it feel free to do so and we can always re-open it.

@coldPen coldPen closed this as completed Sep 30, 2019
@denvercoder
Copy link

For what it's worth I had this same issue and it came down to a case-sensitivity issue. It worked fine on my mac but failed on Netlify's servers because of some of the component names:

import Button from '../components/button

src
- components
- Button
-Button.js

@prydda
Copy link

prydda commented Oct 14, 2019

npm run develop will get you up & running for now.

@mujeeb91
Copy link

mujeeb91 commented Dec 4, 2019

I was facing the same issue. Here's what I did to fix it.

  1. Uninstalled gatsby via npm uninstall -g gatsby-cli
  2. Updated Node version from 8.9.0 -> 12.13.1 (using nvm)
  3. Reinstalled gatsby via npm install -g gatsby-cli

@maiertech
Copy link

This error was introduced by updating an ESLint plugin, which is not related to Gatsby at all. My workaround is to delete yarn.lock and run yarn again to recreate the file. This may be a hint that the issue is triggered by a dependency that Gatsby and whatever caused it have in common.

@DevWichrowski
Copy link

DevWichrowski commented Dec 9, 2019

Hello,
I also had that problem,I just created config file with wrong name ,for typography you need a file src/utils/typography.js

import Typography from "typography"
import fairyGateTheme from "typography-theme-fairy-gates"

const typography = new Typography(fairyGateTheme)

export const { scale, rhythm, options } = typography
export default typography

Also remember about gatsby-config.js in root

module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-typography`,
      options: {
        pathToConfigModule: `src/utils/typography`,
      },
    },
  ],

tmr08c added a commit to tmr08c/tmr08c.github.io that referenced this issue Dec 28, 2019
When trying to build as a part of a GH action, we ran into failures
like:

```
 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

Can't resolve '../components/layout' in '/home/runner/work/tmr08c.github.io/tmr08c.github.io/src/pages'
```

Based on what [others have
seen](gatsbyjs/gatsby#17557 (comment))
it seems like this can be a result of mismatched file name casing.

This commit updates the imports to match the casing of the filename
(which use titlecase).
@ForkInSpace
Copy link

For some of you the issue could be with the node version.
I just switched to node 10.13.0 from 8.9.4 with nvm and the development bundle compiles now w/o an error.

@Jongtelles
Copy link

I am still running into this issue now attempting to follow the Gatsby tutorial, running node v13.6.0

@pravynandas
Copy link

For what it's worth.. for the same package.json file, below two commands install the packages in node_modules quite differently. Pay attention to the 'core-js' folder (to which I'm getting #98123 WEBPACK error. The gatsby new version works great.

Note: Project under test is an official starter example from here

gatsby new gatsby-starter-redux-firebase https://github.com/muhajirdev/gatsby-starter-redux-firebase

npm install (with just only package.json file copied from above folder to another new folder)

Comparison of node_modules from both:
image

Error on gatsby develop
image

@Connor-Callahan
Copy link

deleted my .cache folder - worked like a charm.

@webmastervishal
Copy link

@coldPen i've been testing this today and this one is kinda tricky to triage. Here are the steps i took.

  • Cloned the repo into my ubuntu wsl "machine". I'm running Ubuntu 18.04 LTS
  • Here's the result of gatsby info in Ubuntu.
    cold_pen_wsl_1
  • Installed the dependencies and issued sudo yarn develop, since i've not configured yarn/npm i've got to run it with elevated privileges and i'm presented with the following:
    cold_pen_wsl_2

The errors thrown are based on the fact that i confugured a space for issues regarding gatsby and contenful and when the plugin tries to fetch the data based on your query it will fail.

I would like for you to do a couple of steps to see if you can get it to run in wsl.

  • Remove package-lock.json and/or yarn.lock
  • Issue gatsby clean to purge any stale data.
  • Remove node_modules folder.
  • Install the dependencies again with your package manager of choice, either npm or yarn.
  • Issue gatsby develop and see if the error does not pop back.

These because if memory serves me right it could be some issue with a package.

Feel free to provide feedback so that we can close this issue or continue to work on it until we find a suitable solution.

Works perfectly fine

@alveshelio
Copy link

I'm running into this issue too and I'm on a Mac but my setup is within a monorepo. If I create a new project outside of the monorepo I have no issues, however, if I create a new project within my monorepo or if I create it outside and move it to the monorepo I start having this issue.

One way I found was to remove node_modules and instead of using yarn, I've used npm install and it works just fine. However, this is a no go for me since I need to use yarn workspaces.
Has anyone experiences this same issue with a monorepo?

@bigxalx
Copy link

bigxalx commented Mar 30, 2020

I've been running into this issue using gatsby build (development worked fine) after updating an old gatsby v1 codebase to v2.
It gave me the an additional message that webpack has some error with "vw". Didn't mention file name. I was able to fix it by pinning down the issue to a CSS file and editing the rules that contained calc and vw. It didn't like vw in the denominator. For example I changed stuff like calc(1/5vw) into calc(1vw/5).
Hope this is helpful to anyone who's getting the same issue.

@davidshq
Copy link

davidshq commented Apr 7, 2020

I'm also running into this issue. I've attempted:

  1. Running gatsby clean.
  2. Deleting node_modules, package-lock.json and then re-running npm install followed by gatsby develop.

I'm using a Windows 10 Professional computer running an administrator session on Windows command prompt.

Seems like #19922 and #19268 may be related.

(I had tried using WSLv2 and Git Bash but encountered other issues with these)

@go-cristian
Copy link

I was facing this also, adding "babel-preset-gatsby" to my babel config did the trick.

@shidur81
Copy link

Hi,
I having the following issue when running it. Could you please help me?
I am developing on my Mac.
Screenshot 2020-04-30 at 16 22 45

@shidur81
Copy link

Hi,

I have resolved the issue anyways.

Thanks

@karthickram286
Copy link

This is how I solved this problem,

  1. Switched to node version 12.6.1 using nvm
  2. Remove .cache, node_modules and package-lock.json/yarn-lock.json.
  3. npm install

If the issue persists still, try doing a gatsby clean.

@aaronadamsCA
Copy link
Contributor

aaronadamsCA commented May 9, 2020

I resolved this by removing an old .babelrc.json that referred to a plugin I'd uninstalled.

So if you're stuck, check that too!

@johnmikel
Copy link

@coldPen i've been testing this today and this one is kinda tricky to triage. Here are the steps i took.

  • Cloned the repo into my ubuntu wsl "machine". I'm running Ubuntu 18.04 LTS
  • Here's the result of gatsby info in Ubuntu.
    cold_pen_wsl_1
  • Installed the dependencies and issued sudo yarn develop, since i've not configured yarn/npm i've got to run it with elevated privileges and i'm presented with the following:
    cold_pen_wsl_2

The errors thrown are based on the fact that i confugured a space for issues regarding gatsby and contenful and when the plugin tries to fetch the data based on your query it will fail.

I would like for you to do a couple of steps to see if you can get it to run in wsl.

  • Remove package-lock.json and/or yarn.lock
  • Issue gatsby clean to purge any stale data.
  • Remove node_modules folder.
  • Install the dependencies again with your package manager of choice, either npm or yarn.
  • Issue gatsby develop and see if the error does not pop back.

These because if memory serves me right it could be some issue with a package.

Feel free to provide feedback so that we can close this issue or continue to work on it until we find a suitable solution.

This worked! Fantastic solution.

@baloghrebecca
Copy link

I've encountered the very same problem and I've tried out all the answers on here and it still threw the same error for me.

Turns out I had following import import { clearConfigCache } from "prettier"; in one of my files (not sure where that came from). As soon as I deleted it, it worked again.

@lsmucassi
Copy link

The issue for me is running npm install with sudo, it al went fine when I removed the .lock files and node modules, re-installed modules by just running npm install

@manavm1990
Copy link
Contributor

The main culprit was: '.babelrc' I had created a custom one to work with styled components. In doing so, I had 'disrupted' the 'Gatsby flow'.'

The fix was to make sure I had this in '.babelrc':

"presets": [
    [
      "babel-preset-gatsby",
      {
        "targets": {
          "browsers": [
            ">0.25%",
            "not dead"
          ]
        }
      }
    ]
  ]

Well, "targets" don't necessarily matter - but must include "babel-preset-gatsby"

@kuworking
Copy link

@manavm1990 thanks! Exactly my very same problem, now my working .babelrc looks like this

{
  "plugins": ["babel-plugin-styled-components", "@babel/plugin-proposal-class-properties"],
  "presets": [
    [
      "babel-preset-gatsby",
      {
        "targets": {
          "browsers": [">0.25%", "not dead"]
        }
      }
    ]
  ]
}

@rwchampin
Copy link

Hey Guys - just to confirm - this is 100% from using react-styled-components & perhaps sass as well - im using sass so I had to deal w that too - watch the node-sass version you're runing b it tries to run ^5.0.0 but it should be ^4.0.0 make sure you add gatsby-plugin-styled-components to gatsby-config.js and your .babelrc has, at the minimum:

{
  "presets": ["babel-preset-gatsby"],
  "plugins": ["@babel/plugin-syntax-jsx", "@babel/plugin-proposal-class-properties"]
}

jasim added a commit to pzync/portfolio-website that referenced this issue Mar 13, 2021
@AndrewTraub
Copy link

I'm having the same problem. It's specific to a css file and if I remove reference to the file, the compilation works. The css file though, has worked in the past and has not been modified. I'm getting an error URIERROR: URI Malformed but the line and column referenced in the error is just the } character and my IDE (php storm) is not showing any errors.

@vKeeReaL
Copy link

My fix :)
Be an old-school develop I always name my urgent folders with "#" prefix to make them first into explorer list) And this time I called my folder D://#Sites/gatsby and get this issue. After I've renamed it to D://Sites/gatsby and reinstall gatsby instance, the issue is gone.

@KoolP
Copy link

KoolP commented Aug 30, 2021

updatet a eslint devDependencie with npm install eslint@latest --save-dev from 6. to 7. version fixed my.

@paulvscode
Copy link

Hi, for those still looking for a fix for that issue, and after trying 300000 solutions, what worked for me is to "yarn", let yarn install the yarn.lock, then gatsby develop again. Sounds like yarn is a prerequisite after all...

@Luchanso
Copy link

Luchanso commented Jul 25, 2022

I had the same issue, but after some updates to the yarn.lock file, I got success CI build:
Luchanso/luchanso.github.io@7d43256

I think this happen with babel plugin - maybe exist not compatible patch version with gatsby

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
Development

No branches or pull requests