garris / garris/BackstopJS

Setting Webpack's "devtool" option to "eval" may crash PhantomJS

Open
#495 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.2k
Forks
621
PR merge metrics
No merged PRs in 30d

Description

This is more of a friendly warning than an actual defect with BackstopJS, but I was struggling with getting Backstop to run locally with a React app. (it worked fine against our production app)

After much fruitless internet searching, (and suspecting the problem might be in the difference between our development and staging/production environments) I started looking into our webpack config and found that setting the Webpack 'devtool' option to 'eval' was the cause of my troubles (https://webpack.js.org/configuration/devtool/). I've opted for 'inline-source-map' in our dev environment and now Backstop runs as expected.

Here's the output of attempting to run 'backstop reference' when the devtool option was set to 'eval'

$ backstop reference
BackstopJS loading config: /Users/af/Documents/repo-name/backstop.json

COMMAND | Executing core for `reference`
clean | backstop_data/bitmaps_reference was cleaned.

Running CasperJS with: [ '/Users/af/.nvm/versions/node/v6.10.3/lib/node_modules/backstopjs/capture/genBitmaps.js',
'--captureConfigFileName=/var/folders/5x/jjdd7w5x3d3bhf17gqn2ynqc0000gn/T/capture/a9eb61eca662355c771a989cf3c8760a1c10a842.json' ]
CasperJS: Debug is enabled!
CasperJS: CREATING NEW REFERENCE FILES
CasperJS: [info] [phantom] Starting...
CasperJS: [info] [phantom] Running suite: 12 steps
CasperJS: [debug] [phantom] Successfully injected Casper client-side utilities
CasperJS: onBefore.js has run for iphone_portrait.
CasperJS: [info] [phantom] Step anonymous 1/12: done in 42ms.
CasperJS: [info] [phantom] Step _step 2/13: done in 53ms.
CasperJS: [debug] [phantom] opening url: http://localhost:3000/, HTTP GET
CasperJS: [debug] [phantom] Navigation requested: url=http://localhost:3000/, type=Other, willNavigate=true, isMainFrame=true
CasperJS: [debug] [phantom] url changed to "http://localhost:3000/"
CasperJS: Warning: Accessing PropTypes via the main React package is deprecated, and will be removed in React v16.0. Use the latest available v15.* prop-types package from npm instead. For info on usage, compatibility, migration and more, see https://fb.me/prop-types-docs
CasperJS: Warning: Accessing PropTypes via the main React package is deprecated, and will be removed in React v16.0. Use the latest available v15.* prop-types package from npm instead. For info on usage, compatibility, migration and more, see https://fb.me/prop-types-docs
CasperJS: Warning: Accessing createClass via the main React package is deprecated, and will be removed in React v16.0. Use a plain JavaScript class instead. If you're not yet ready to migrate, create-react-class v15.* is available on npm as a temporary, drop-in replacement. For more info see https://fb.me/react-create-class
CasperJS: PhantomJS has crashed. Please read the bug reporting guide at
CasperJS: and file a bug report.

Testing script failed with code: null

An unexpected error occured. You may want to try setting the debug option to `true` in your config file.
COMMAND | Command `reference` ended with an error
COMMAND | Error: An unexpected error occured. You may want to try setting the debug option to `true` in your config file.
at ChildProcess. (/Users/af/.nvm/versions/node/v6.10.3/lib/node_modules/backstopjs/core/util/createBitmaps.js:71:18)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:886:16)
at Socket. (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:497:12)

... yet another reason that "eval is evil"...

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.