lloeki / matterfront

Mattermost frontend app for OS X, Windows and Linux
MIT License
152 stars 27 forks source link

error on npm run start-watch #60

Closed dalenoe closed 8 years ago

dalenoe commented 8 years ago

ERROR in ./~/css-loader!./src/browser/index.css Module build failed: ReferenceError: Promise is not defined

any ideas?

LongLiveCHIEF commented 8 years ago

you have run npm install to make sure all of the latest deps are avaialble on your resolve path?

dalenoe commented 8 years ago

Yes. This is what I've followed so far.

https://github.com/gregkbarnes/blank-canvas/commit/f21b1f1713e4cff293ab6aaf390f27cb83417623

After adding that, it starts with no errors.

dalenoe commented 8 years ago

Now, when I run npm run start. I get the mattermost window popping up, but it's a blank white screen.

LongLiveCHIEF commented 8 years ago

we don't use Promise anywhere in our library, so adding a dependency for something our own modules don't use wouldn't be something we'd do.

It looks like this is a result of https://github.com/webpack/css-loader/issues/144, and that you're using a very old version of node.

We do need to add an "engines" block to our package.json so a warning will be thrown when you're using a version of node prior to v4.

dalenoe commented 8 years ago

@H3Chief This is on a ubuntu server, with node installed using apt-get. If the library doesn't use Promise, why was I seeing that Promise error?

geekytime commented 8 years ago

This is on a ubuntu server, with node installed using apt-get.

Unfortunately, the pre-built packages in the apt-get repos are often quite outdated. :disappointed:

Can you run node -v and check your version?

For a while a guy named Chris Lea had something called a PPA that people were using to get the more recent builds, but I think now they're trying to get people to use these nodesource distributions?

Oh wait, yeah! Here it is. Now there's Installing Node.js via package manager on the node site. That's probably your best bet.

If the library doesn't use Promise, why was I seeing that Promise error?

One of the underlying dependencies must be using the native Promise object.

LongLiveCHIEF commented 8 years ago

The Webpack/css-loader package uses them. See the issue I referenced above, it explains why you're seeing the Promise error.