TypeError: Cannot read property 'replace' of undefined
- Dominant language
- JavaScript
- Stars
- 700
- Forks
- 89
- PR merge metrics
- No merged PRs in 30d
Description
I have tried everything and despite an irksome feeling that it is my incompetence I am at a loss.
I have the folder structure:
```
dist/
app/
|- js/
main.js
plugins.js
|- embeds/
footer.php
```
footer.php looks like this:
```
© My site 2017
```
My gulp task looks like this:
```
gulp.task('useref', function () {
return gulp.src('app/embeds/footer.php')
.pipe(useref())
.pipe(gulp.dest('dist'))
});
```
I keep getting this error:
```
TypeError: Cannot read property 'replace' of undefined
at module.exports (/my-project/repo/node_modules/useref/lib/getBlocks.js:31:19)
at module.exports (/my-project/repo/node_modules/useref/index.js:8:16)
at Gulp. (/my-project/repo/gulpfile.js:108:15)
at module.exports (/my-project/repo/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/my-project/repo/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/my-project/repo/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/my-project/repo/node_modules/orchestrator/index.js:134:8)
at /usr/local/lib/node_modules/gulp-cli/lib/versioned/^3.7.0/index.js:46:20
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
```
Contributor guide
Assessment
This issue has not been assessed yet.