Comments (9)
I think I removed it accidentally earlier... though it was working on my
machine. I'll be home in a bit and will fix and release. Thanks for filing
an issue!
In the meantime downgrade to 0.5.0 which is almost identical.
On Sat, Oct 3, 2015 at 6:01 PM Luandro [email protected] wrote:
Just installed a fresh copy of gatsby, and created a blog. When I try to
run gatsby serve I get this error:/usr/local/lib/node_modules/gatsby/lib/utils/serve.js:2
import Hapi from 'hapi';
^^^^^^
SyntaxError: Unexpected reserved wordSeems like babel isn't running for some reason. Any clues?
—
Reply to this email directly or view it on GitHub
#54.
from gatsby.
👍
from gatsby.
Hmmm... so babel-node doesn't work with globally installed packages...
babel/babel#1889
It's suggested that you pre-compile your code... not fun...
from gatsby.
Ok, I think things should work now with 0.6.1.
@gesposito looks like we're either going to have to go vanilla ES5 or pre-compile code.
from gatsby.
What are the steps to reproduce this?
I have 0.6.0 -g install
ed and I tested serve
against all the starter sites and they worked.
from gatsby.
Basically that :) Did you run npm link
though against your local clone of Gatsby? It does work in that scenario which is why I didn't detect it until @luandro reported the bug.
from gatsby.
Yeah, I still had the npm link
ed version on.
I'll take a look at it if I can.
from gatsby.
So, I dug a bit, and found that babel
actually might ignore gatsby
because its ignore includes node_modules
where gatsby
is npm install
ed (as per babel/babel#1270, babel/babel#1889 as you referenced).
Some solutions that I couldn't get to work are:
reverse ignore gatsby
:
require('babel/register')({
ignore: /node_modules\/(?!gatsby)/
});
or explicitly include
require("babel/register")({
only: ["gatsby/lib"]
});
use env babel-node
*
#!/usr/bin/env babel-node
spawn a child process/command*
./node_modules/.bin/babel-node --harmony ./bin/cli.js
*Note: both babel-node
based solutions are not meant for production use.
Last one, that is the advised solution is to
precompile, i.e.:
"compile": "coffee --output dist --compile lib && babel -d dist/ lib/",
"prepublish": "npm run compile"
that would require some project restructuring.
from gatsby.
Thanks for your research! Yeah, precompile is doable but takes some careful setup.
from gatsby.
Related Issues (20)
- matchPath seems to be broken since adapters
- The first Headless CMS starter link is broken
- Gatsby + Directus = Build not working HOT 1
- Validation error
- Unexpected missing while creating page
- Invoking imported function inside `createPages` results in error HOT 1
- Gatsby 4 Upgrade - SyntaxError: Invalid left-hand side in assignment
- command curl -X POST http://localhost:8000/__refresh doesn't delete the documents from the CMS
- Serverless function in Gatsby site throwing error and not returning data locally HOT 1
- Using webpack-dev-middleware results with npm audit high vulnerability HOT 1
- Add a short how-to article for removing the 8px margin in html body
- Error using TypeScript package using workspace in gatsby-node.ts : ReferenceError: Cannot access 'D' before initialization
- React Peer Dependency Issue with gatsby-plugin-mdx HOT 6
- Gatsby performance/page-load issue on Mobile. HOT 1
- Query returning some of the key as null but if you fetch it with postman it's giving proper response
- gatsby-source-contentful with DSG on a page giving error when accessed from Vercel
- failed Validating Rendering Engines in strict mode
- Gatsby is failed at production Javascript and CSS HOT 1
- SSR Function crashing from deployed Workspace App HOT 1
- Enable gatsby-plugin-sass to allow sass-embedded
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby.