question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting socket.io.js & commons.js error while loading github pages built using gatsby

See original GitHub issue

Description

Getting socket.io.js & commons.js error while loading github pages built using gatsby (https://jaanhio.github.io/).

I am not sure why these 2 errors are appearing. Could it be some dependencies issue?

Environment

Gatsby version: 1.9.119 Node.js version: 8.4.0 Operating System: macOS Sierra

File contents (if changed):

gatsby-config.js:

module.exports = {
  siteMetadata: {
    title: `jaanhio`
  },
  plugins: [
    `gatsby-plugin-react-helmet`,
    `gatsby-plugin-styled-components`,
  ],
}

package.json:

{
  "name": "gatsby-starter-default",
  "description": "Gatsby default starter",
  "version": "1.0.0",
  "author": "Kyle Mathews <mathews.kyle@gmail.com>",
  "dependencies": {
    "gatsby": "^1.9.119",
    "gatsby-link": "^1.6.28",
    "gatsby-plugin-favicon": "^2.0.0",
    "gatsby-plugin-react-helmet": "^1.0.8",
    "gatsby-plugin-styled-components": "^2.0.2",
    "material-ui": "^1.0.0-beta.21",
    "react-animations": "^1.0.0",
    "react-anime": "^2.0.1",
    "react-headroom": "^2.2.2",
    "react-reveal": "^0.7.3",
    "react-scroll": "^1.6.4",
    "react-social-icons": "^2.7.0",
    "react-typing-animation": "^1.1.5",
    "styled-components": "^2.2.4"
  },
  "keywords": [
    "gatsby"
  ],
  "license": "MIT",
  "main": "n/a",
  "scripts": {
    "deploy": "gatsby build --prefix-paths && gh-pages -d public",
    "build": "gatsby build",
    "develop": "gatsby develop",
    "format": "prettier --trailing-comma es5 --no-semi --single-quote --write \"src/**/*.js\"",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "devDependencies": {
    "eslint": "^4.11.0",
    "eslint-config-airbnb": "^16.1.0",
    "eslint-plugin-import": "^2.8.0",
    "eslint-plugin-jsx-a11y": "^6.0.2",
    "eslint-plugin-react": "^7.5.1",
    "gh-pages": "^1.1.0",
    "prettier": "^1.8.2"
  }
}

Actual result

GET https://jaanhio.github.io/socket.io/socket.io.js net::ERR_ABORTED
jaanhio.github.io/:2 
GET https://jaanhio.github.io/commons.js 404 ()

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

29reactions
markmichoncommented, Dec 15, 2017

It looks like your index file is somehow the index created by gatsby develop and not the one from gatsby build. Try clearing out your pubic folder, then run gatsby build. You can test by running gatsby serve before pushing overything up to github pages.

15reactions
jimfilippoucommented, May 25, 2020

I am still seeing this, why is this happening? also why it’s closed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gatsby socket and commons.js error when loading website
Your issue appears because there's no socket.io.js file, so it throws a 404 error (not found). I'd suggest: Refresh the cache by running ......
Read more >
Troubleshooting Common Errors - Gatsby
The following errors are related to styles in your site, using CSS, preprocessors, or CSS-in-JS solutions. Inconsistent CSS styles between develop and build ......
Read more >
How To Set Up Your First Gatsby Website | DigitalOcean
Install the Gatsby Starter default template. Modify metadata in gatsby-config.js . Run the development server and view the Gatsby site locally.
Read more >
unhandled runtime error after working on my project for weeks
One unhandled runtime error found in your files. ... while the page was loading. commons.js line 285 > eval:85:13 [socket.io] Disconnected ...
Read more >
Real-time Chat Forum using Strapi, Socket.io, React and ...
It is designed to build practical, production-ready Node.js APIs in hours instead of weeks.” What is a Headless CMS? If you are a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found