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)
- useStaticQuery breaking in Production for some users v5 HOT 4
- GraphiQL White Screen of Death on Gatsby V5.11.0 HOT 34
- ERROR #98123 WEBPACK: Generating SSR bundle failed HOT 8
- Error: Generated engines use disallowed import "node:crypto". Only allowed imports are to Node.js builtin modules or engines internals. HOT 1
- Adding content in the contributing.md file HOT 1
- change "Twitter" to "X (Twitter)" in README.md in Support And also in docs/contributing/index.md HOT 1
- environment variables not needed by SSR/DSG are being embedded in data.mdb
- navigate to newer version of the docs when you click search result in old version HOT 5
- query with `headings` field causes gatsby-transformer-remark to be run multiple times
- Is Gatsby discontinued? Please upvote for clarification. HOT 12
- Building multiple page categories with MarkdownRemark fails
- Skip media from download, get URL in query only
- Outdated reference to Gatsby Cloud in documentation HOT 1
- While shadowing a css file from a gatsby theme the changes are reflected in netlify preview but not on deployment HOT 4
- Null-Byte (\0) in HTML output files
- Missing onError handler for invocation 'building-schema', error was 'Error: Cannot create as TypeComposer the following value: Date.' HOT 1
- onClientEntry not called when using `gatsby develop`
- Redirects and Headers stopped working on Netlify (and work again in gatsby 5.12.12 / adapter 1.0.4) HOT 9
- Showcase page has some sites which are not using Gatsby js anymore, and still they are in Featured sites section HOT 4
- Show case crashed when search HOT 1
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.