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

Cannot read property 'start' of undefined #94

Closed
malonehedges opened this issue Dec 7, 2017 · 2 comments
Closed

Cannot read property 'start' of undefined #94

malonehedges opened this issue Dec 7, 2017 · 2 comments

Comments

@malonehedges
Copy link

malonehedges commented Dec 7, 2017

Hi,

I have three files which I will put below. When using the parcel watch src/index.html or parcel src/index.html commands, everything is fine and works great. However, using parcel build src/index.html fails with the following error:

❯ parcel build src/index.html
🚨  /Users/me/projectpathhere/src/index.js: Cannot read property 'start' of undefined
    at module.exports (/Users/me/.config/yarn/global/node_modules/babel-to-estree/babylon-to-espree/attachComments.js:56:41)
    at module.exports (/Users/me/.config/yarn/global/node_modules/babel-to-estree/babylon-to-espree/index.js:35:3)
    at exports.toEstree (/Users/me/.config/yarn/global/node_modules/babel-to-estree/index.js:9:3)
    at module.exports (/Users/me/.config/yarn/global/node_modules/parcel-bundler/src/transforms/uglify.js:10:39)
    at <anonymous>

Also would like to point out that doing parcel build src/index.js fails, but parcel build src/style.css works.

And now the files:

src/index.html

<!doctype html>
<html>
<head>
  <title>w o w</title>
</head>
<body>
  <h1>WOW</h1>
  <script src='./index.js'></script>
</body>
</html>

src/index.js

import randomColor from 'randomcolor'
import './style.css'

setInterval(() => {
  document.body.style.backgroundColor = randomColor({
    luminosity: 'bright',
  })
}, 500)

src/style.css

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  transition: background-color 0.5s ease-in;
}

h1 {
  text-align: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 5em;
  line-height: 5em;
}
@Ontopic
Copy link

Ontopic commented Dec 7, 2017

For me a temporary fix was adding the --no-minify flag

@chee
Copy link

chee commented Dec 7, 2017

this is a duplicate of #8

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

4 participants