Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

Node should be added to the requirements and note that it is the only runtime that works for Windows 7. #31

@CookieOfFortune

Description

@CookieOfFortune

Windows 7 64-bit
pyexecjs 1.1.0
pyv8 1.0
NodeJS 4.0.0

Using execjs with pyv8 (it seems that PyV8 takes precedence):

import execjs

execjs.get().name
Out[2]: u'PyV8'

from react import jsx
jsx.transform('helloworld.jsx')
Traceback (most recent call last):

  File "<ipython-input-4-ba80c49e788e>", line 1, in <module>
    jsx.transform('helloworld.jsx')

  File "C:\Python27\python-2.7.6.amd64\lib\site-packages\react\jsx.py", line 64, in transform
    return JSXTransformer().transform(jsx_path, **opts)

  File "C:\Python27\python-2.7.6.amd64\lib\site-packages\react\jsx.py", line 51, in transform
    js = self.transform_string(i.read(), **kwargs)

  File "C:\Python27\python-2.7.6.amd64\lib\site-packages\react\jsx.py", line 45, in transform_string
    raise TransformError(e.message[7:])

TransformError: ()

'JScript' was my original runtime:

import os
os.environ['EXECJS_RUNTIME'] = 'JScript'
jsx.transform('helloworld.jsx')
Traceback (most recent call last):

  File "<ipython-input-7-ba80c49e788e>", line 1, in <module>
    jsx.transform(helloworld.jsx')

  File "C:\Python27\python-2.7.6.amd64\lib\site-packages\react\jsx.py", line 64, in transform
    return JSXTransformer().transform(jsx_path, **opts)

  File "C:\Python27\python-2.7.6.amd64\lib\site-packages\react\jsx.py", line 51, in transform
    js = self.transform_string(i.read(), **kwargs)

  File "C:\Python27\python-2.7.6.amd64\lib\site-packages\react\jsx.py", line 45, in transform_string
    raise TransformError(e.message[7:])

TransformError: or: 'undefined' is null or not an object

But installing NodeJS and using it as the runtime works:

os.environ['EXECJS_RUNTIME'] = 'Node'

In [9]: jsx.transform('helloworld.jsx')
Out[9]: u'var HelloMessage = React.createClass({displayName: \'HelloMessage\',\n  render: function() {\n    return React.createElement("div", null, "Hello ", this.props.name);\n  }\n});\n\nReact.render(React.createElement(HelloMessage, {name: "John"}), mountNode);'

So I guess that should be added to the readme. I have uninstalled PyV8 and now Node is the default runtime under execjs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions