Closed super-cache-money closed 9 years ago
I'm getting similarly weird behaviour that may be related...when rendering a react component that I want < as text (for example in a breadcrumb menu), it also breaks.
I might have the same thing on this project https://github.com/tcurdt/react-app. When I run
$ browserify -o bundle.js -t reactify ./app/client/main.js
it is not transforming some of the jsx
files.
Error: Parsing file react-app/node_modules/react-tc-typeahead/src/typeahead/index.jsx: Unexpected token (101:8)
at Deps.parseDeps (/usr/local/lib/node_modules/browserify/node_modules/module-deps/index.js:418:28)
at fromSource (/usr/local/lib/node_modules/browserify/node_modules/module-deps/index.js:361:48)
at /usr/local/lib/node_modules/browserify/node_modules/module-deps/index.js:356:17
at ConcatStream.<anonymous> (/usr/local/lib/node_modules/browserify/node_modules/concat-stream/index.js:32:43)
at ConcatStream.emit (events.js:129:20)
at finishMaybe (/usr/local/lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js:460:14)
at endWritable (/usr/local/lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js:469:3)
at ConcatStream.Writable.end (/usr/local/lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js:436:5)
at DuplexWrapper.onend (/usr/local/lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_readable.js:537:10)
at DuplexWrapper.g (events.js:199:16)
Same behaviour when calling it directly via browserify API
var b = browserify({
basedir: root,
entries: [ "./app/client/main.js" ],
debug: true,
transform: [ reactify ],
extensions: [ ".jsx" ],
cache: {},
packageCache: {},
fullPaths: true
});
b.bundle(function(err, src) {
if (err) return cb(err, src);
cb(null, src);
})
.pipe(fs.createWriteStream("bundle.js"));
I ran into a problem along these lines. I was able to get it to work by using -g reactify rather than -t reactify. Not sure what the difference is or why this works, but you might try it.
I added troubleshooting section to README: https://github.com/andreypopp/reactify#troubleshooting
OK so this is super weird, I'm usually a happy user of reactify, but in one case of mine, I can't get it to perform the transform! I have this:
At the top of
client.jsx
, I have specified:This throws an Unexpected token error on the first
<
of a jsx tag.Weirdly,
browserify -t reactify client.jsx
works fine.What could be going on here?