question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error using config object

See original GitHub issue

I’ve been unable to get backstop to work by passing a config object instead of a path to a config file (which I can get to work, but is sub-optimal). Even using the example in the readme fails:

var gulp         = require('gulp')
,   backstop     = require('backstopjs')
;

gulp.task('test-css', function() {
    backstop('test', {
      config: {
        id: "foo",
        scenarios: [
          //some scenarios here
        ]
      }
    });
});

Output:

λ gulp test-css
(node:5188) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[10:55:01] Using gulpfile ~\Sites\itc.visitidaho\gulpfile.js
[10:55:01] Starting 'test-css'...
[10:55:01] 'test-css' errored after 1.47 ms
[10:55:01] TypeError: Path must be a string. Received { id: 'foo', scenarios: [] }
    at assertPath (path.js:7:11)
    at Object.isAbsolute (path.js:439:5)
    at loadProjectConfig (C:\Users\slittle\Sites\itc.visitidaho\node_modules\backstopjs\core\util\makeConfig.js:22:14)
    at makeConfig (C:\Users\slittle\Sites\itc.visitidaho\node_modules\backstopjs\core\util\makeConfig.js:59:20)
    at module.exports (C:\Users\slittle\Sites\itc.visitidaho\node_modules\backstopjs\core\runner.js:5:16)
    at Gulp.<anonymous> (C:\Users\slittle\Sites\itc.visitidaho\gulpfile.js:6:5)
    at module.exports (C:\Users\slittle\Sites\itc.visitidaho\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (C:\Users\slittle\Sites\itc.visitidaho\node_modules\gulp\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (C:\Users\slittle\Sites\itc.visitidaho\node_modules\gulp\node_modules\orchestrator\index.js:214:10)
    at Gulp.Orchestrator.start (C:\Users\slittle\Sites\itc.visitidaho\node_modules\gulp\node_modules\orchestrator\index.js:134:8)

It looks like in makeConfig.js:20 it always assumes options.config is a file path?

node v6.10.0 npm v4.3.0 backstopjs v2.6.7

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
garriscommented, Mar 13, 2017

I published this out. You can install via npm install -g backstopjs@canary

If anyone wants to validate that would be great. I’ll push this out to @latest later today.

Thanks @skip405 and @Enchiridion – really appreciate the report and quick turnaround! 👍

0reactions
garriscommented, Mar 13, 2017

Great. Pushed to @latest. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Config error with object reference error - Help
When you created a project in REF, by default there will be activities in Init state which reads the config file into Config...
Read more >
error message "Configuration object replaced by user "
i have lots of error messages in the log file applications.1.log. Configuration object replaced by user index_service. i didn'nt make any change in...
Read more >
Still having big problems with Object reference not set to an ...
The error means that your code is trying to access/reference an object that is a null valued object that is not there in...
Read more >
Bundler Error Invalid configuration object. Webpack has been ...
Invalid configuration object. Webpack has been initialised using a configuration object that does not match Heres my webpack.config.js file.
Read more >
UVM Fatal Error :Unable to find configuration object
Hi, i have been writing a code where i am using configuration database.So i set uvm_config_db in top i.e.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found