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

I can't run example code #25

Closed
szymex73 opened this issue Jul 24, 2017 · 10 comments
Closed

I can't run example code #25

szymex73 opened this issue Jul 24, 2017 · 10 comments
Labels

Comments

@szymex73
Copy link

I copy/pasted example code and tried to use jsx npm module to run it, transpile it, I also tried to transpile it using Babel but that didn't work either.
How should I run it?

@FlorianWendelborn
Copy link

Did you set the pragma to h?

@szymex73
Copy link
Author

I did, I tried to run babel again and it worked like after 6 tries

@TimRChen
Copy link

I meet the same situation..

@gailingmic
Copy link

how exactly have you fixed this?
I can't get it to work at all with this setup

package.json

{
  "name": "inkTest",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "scripts": {
    "build": "babel index.js --out-file index.transpiled.js"
  },
  "dependencies": {
    "babel-cli": "^6.24.1",
    "babel-plugin-transform-react-jsx": "^6.24.1",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-node6": "^11.0.0",
    "ink": "^0.3.0"
  }
}

.babelrc

{
  "presets": [
    "es2015"
  ],
  "plugins": [
		[
			"transform-react-jsx",
			{
				"pragma": "h",
				"useBuiltIns": true
			}
		]
	]
}

@szymex73
Copy link
Author

My NodeJS version is v7.10.0
npm install --save-dev babel-plugin-transform-h-jsx
.babelrc

{
        "plugins": ["transform-h-jsx"]
}

Hope this helps

@vadimdemedes
Copy link
Owner

@TimRChen @gailingmic what error do you get?

@vadimdemedes vadimdemedes reopened this Jul 27, 2017
@TimRChen
Copy link

I run the demo successfully by using https://github.com/vadimdemedes/generator-ink-cli. Thanks for the generator. @vadimdemedes

@vadimdemedes
Copy link
Owner

You're welcome, @TimRChen!

@jaywcjlove
Copy link

@szymex73 example code https://github.com/TimRChen/react-cli

@vadimdemedes
Copy link
Owner

Closing due to lack of response. Feel free to reply here or open a new issue with more details, if anyone's still experiencing problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants