Crawl failing with syntax error
See original GitHub issueI seem to have run into a error which I can’t pinpoint the source of. I’m thinking that its some dependency issue.
My setup: Using create-react-app (react-scripts 0.9.5) Which uses jsdom 9.12.0, react and react-dom 15.4.2
Having this very basic example:
import React from 'react';
import {render} from 'react-snapshot';
const TestComponent = () => (
<div><h1>Test</h1></div>
);
render(<TestComponent/>, document.querySelector('main'));
Which throws following error when running react-scripts build && react-snapshot
:
(paths shortened to start at project root)
Starting crawling http://localhost:2999 Error: Uncaught [SyntaxError: Unexpected token <] at reportException (…\node_modules\jsdom\lib\jsdom\living\helpers\runtime-script-errors.js:58:24) at processJavaScript (…\node_modules\jsdom\lib\jsdom\living\nodes\HTMLScriptElement-impl.js:130:7) at HTMLScriptElementImpl._eval (…\node_modules\jsdom\lib\jsdom\living\nodes\HTMLScriptElement-impl.js:65:7) at e (…\node_modules\jsdom\lib\jsdom\browser\resource-loader.js:31:22) at Object.check (…\node_modules\jsdom\lib\jsdom\living\nodes\Document-impl.js:89:11) at …\node_modules\jsdom\lib\jsdom\living\nodes\Document-impl.js:108:12 at wrappedEnqueued (…\node_modules\jsdom\lib\jsdom\browser\resource-loader.js:255:16) at Request.request [as _callback] (…\node_modules\jsdom\lib\jsdom\browser\resource-loader.js:203:9) at Request.self.callback (…\node_modules\request\request.js:188:22) at emitTwo (events.js:106:13) SyntaxError: Unexpected token < at Object.exports.runInContext (vm.js:66:16) at processJavaScript (…\node_modules\jsdom\lib\jsdom\living\nodes\HTMLScriptElement-impl.js:128:10) at HTMLScriptElementImpl._eval (…\node_modules\jsdom\lib\jsdom\living\nodes\HTMLScriptElement-impl.js:65:7) at e (…\node_modules\jsdom\lib\jsdom\browser\resource-loader.js:31:22) at Object.check (…\node_modules\jsdom\lib\jsdom\living\nodes\Document-impl.js:89:11) at …\node_modules\jsdom\lib\jsdom\living\nodes\Document-impl.js:108:12 at wrappedEnqueued (…\node_modules\jsdom\lib\jsdom\browser\resource-loader.js:255:16) at Request.request [as _callback] (…\node_modules\jsdom\lib\jsdom\browser\resource-loader.js:203:9) at Request.self.callback (…\node_modules\request\request.js:188:22) at emitTwo (events.js:106:13) ✏️ Saving / as /index.html � Finished crawling.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
that above PR from kevin looks much better than my ugly code and I also did a lot of other stuff for my personal use so i didn’t want to make a PR out of that directly. Wanted to see what the opinion on it is first.
Closing issue as this is now implemented in 1.0.5-0. Would be nice to publish to npm tho as the npm registry still has 1.0.4 as its current version