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

Error with basic example: base[type] is not a function #30

Open
@laurenkt

Description

@laurenkt
  • nativejsx 4.3.0
  • node 9.5.0

With the following file:

console.log(
	<div>
		<h1>Test</h1>
	</div>
)

Invoked via command-line: nativejsx src/index.jsx

I get this error:

$ node_modules/.bin/nativejsx src/index.jsx
/Users/lauren/Projects/physmod/node_modules/nativejsx/node_modules/acorn/dist/walk.js:29
    base[type](node, st, c);
              ^

TypeError: base[type] is not a function
    at c (/Users/lauren/Projects/physmod/node_modules/nativejsx/node_modules/acorn/dist/walk.js:29:15)
    at Object.walkers.JSXElement (/Users/lauren/Projects/physmod/node_modules/nativejsx/source/walkers.js:184:9)
    at c (/Users/lauren/Projects/physmod/node_modules/nativejsx/node_modules/acorn/dist/walk.js:29:15)
    at Object.walkers.CallExpression (/Users/lauren/Projects/physmod/node_modules/nativejsx/source/walkers.js:31:9)
    at c (/Users/lauren/Projects/physmod/node_modules/nativejsx/node_modules/acorn/dist/walk.js:29:15)
    at Object.skipThrough (/Users/lauren/Projects/physmod/node_modules/nativejsx/node_modules/acorn/dist/walk.js:183:37)
    at c (/Users/lauren/Projects/physmod/node_modules/nativejsx/node_modules/acorn/dist/walk.js:29:15)
    at Object.base.ExpressionStatement.base.ParenthesizedExpression (/Users/lauren/Projects/physmod/node_modules/nativejsx/node_modules/acorn/dist/walk.js:201:35)
    at c (/Users/lauren/Projects/physmod/node_modules/nativejsx/node_modules/acorn/dist/walk.js:29:15)
    at Object.skipThrough (/Users/lauren/Projects/physmod/node_modules/nativejsx/node_modules/acorn/dist/walk.js:183:37)

If I change the file to:

console.log(
	<div />
)

It works fine.

I thought perhaps it was something to do with the node version but all the tests run fine (except when I add an extra test to parse this file).

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions