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.

Unexpected EOF at line 1 column 2 of the JSON5 data. Still to read: ""

See original GitHub issue

🐛 Bug Report

🎛 Configuration (.babelrc, package.json, cli command)

.babelrc

{
  "presets": ["env"]
}

package.json

{
  "name": "irbo",
  "version": "1.0.0",
  "main": "server.js",
  "license": "MIT",
  "devDependencies": {
    "autoprefixer": "^8.0.0",
    "babel-preset-env": "^1.6.1",
    "cross-env": "^5.1.3",
    "nodemon": "^1.14.12",
    "parcel-bundler": "^1.5.1",
    "stylus": "^0.54.5"
  },
  "dependencies": {
    "babel-polyfill": "^6.26.0"
  },
  "scripts": {
    "dev": "parcel client/index.html",
    "dev-with-server": "cross-env NODE_ENV=development parcel watch client/index.html",
    "test": "cross-env NODE_ENV=test",
    "prod": "cross-env NODE_ENV=production parcel build client/index.html --out-dir public --public-url ./"
  }
}

🤔 Expected Behavior

The expected behavior is that the files should parse correctly and a dev server should spin up.

I am new to Parcel and am just testing out some of the basic configurations. I am not trying anything too complex right now.

😯 Current Behavior

I have a blank index.html file with a CSS and a JS file linked in. When I initially ran yarn run dev, everything was fine. But after I changed the content in the index.html file, I got this error:

/home/path/to/file/index.html: Unexpected EOF at line 1 column 2 of the JSON5 data. Still to read: ""
    at error (/home/path/to/file/node_modules/json5/lib/json5.js:56:25)
    at word (/home/path/to/file/node_modules/json5/lib/json5.js:393:13)
    at value (/home/path/to/file/node_modules/json5/lib/json5.js:493:56)
    at /home/path/to/file/node_modules/json5/lib/json5.js:508:18
    at Object.load (/home/path/to/file/node_modules/parcel-bundler/src/utils/config.js:44:14)
    at <anonymous>

💁 Possible Solution

I have no idea. It appears to be a problem with Parcel, but I am not certain about that.

🔦 Context

I am just learning Parcel and trying to test some different configurations.

💻 Code Sample

Bitbucket repo: https://bitbucket.org/samwell/irbo/src

🌍 Your Environment

Parcel: 1.5.1 (local installation instead of global) Node: 8.9.4 npm: 5.6.0 Yarn: 1.3.2 OS: Ubuntu 16.04

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
netaisllccommented, Apr 16, 2018

I had the same error as a result of having an empty

.babelrc

file

1reaction
SamuelEarlcommented, Feb 15, 2018

I found the problem. I had a blank .posthtmlrc file in my project root that was throwing the error. As soon as I removed the file the error went away. When I created a new, blank .posthtmlrc file the error came back.

All is good in the world again!

I am loving Parcel! Keep up the good work!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error while parsing JSON - Unexpected EOF at line 1 column ...
Error while parsing JSON - Unexpected EOF at line 1 column 2 of the JSON5 data. when I npm run build ... Still...
Read more >
Babel转码时报错Unexpected EOF at line 1 column 2 of the ...
问题描述:. 使用Babel转码时报错: Error while parsing JSON - Unexpected EOF at line 1 column 2 of the JSON5 data. Still to read: “”
Read more >
SyntaxError: unexpected EOF while parsing - LearnDataSci
EOF stands for "end of file," and this syntax error occurs when Python detects an unfinished statement or block of code. This can...
Read more >
Error Occurs With installing .Babelrc - Codecademy Forums
... Error while parsing JSON - Syntax error at line 4 column 1 of the JSON5 data. Still to read: "“name”: “minesweeper”
Read more >
Вопрос №14129 от пользователя Радик Галиуллин в проекте
SyntaxError: /home/rd/.babelrc: Error while parsing JSON - Unexpected EOF at line 1 column 2 of the JSON5 data. Still to read: "".
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