-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'toString' of null #45
Comments
Exactly the same problem started to appear here out of nowhere. I'm running on linux mint: joe@joes-HP-EliteBook-8470p ~/eclipseWorkspace/iD8266 $ gulp
[07:37:51] Using gulpfile ~/eclipseWorkspace/iD8266/gulpfile.js
[07:37:51] Starting 'clean'...
[07:37:51] Starting 'files'...
[07:37:51] Starting 'inline'...
[07:37:51] Finished 'clean' after 89 ms
[07:37:54] Finished 'files' after 3.57 s
/home/joe/eclipseWorkspace/iD8266/node_modules/gulp-inline/index.js:50
el.attr('src', 'data:image/unknown;base64,' + contents.toString('base64'))
^
TypeError: Cannot read property 'toString' of null
at template (/home/joe/eclipseWorkspace/iD8266/node_modules/gulp-inline/index.js:50:61)
at Transform._transform (/home/joe/eclipseWorkspace/iD8266/node_modules/gulp-inline/index.js:202:20)
at Transform._read (/home/joe/eclipseWorkspace/iD8266/node_modules/gulp-inline/node_modules/readable-stream/lib/_stream_transform.js:184:10)
at Transform._write (/home/joe/eclipseWorkspace/iD8266/node_modules/gulp-inline/node_modules/readable-stream/lib/_stream_transform.js:172:12)
at doWrite (/home/joe/eclipseWorkspace/iD8266/node_modules/gulp-inline/node_modules/readable-stream/lib/_stream_writable.js:237:10)
at writeOrBuffer (/home/joe/eclipseWorkspace/iD8266/node_modules/gulp-inline/node_modules/readable-stream/lib/_stream_writable.js:227:5)
at Transform.Writable.write (/home/joe/eclipseWorkspace/iD8266/node_modules/gulp-inline/node_modules/readable-stream/lib/_stream_writable.js:194:11)
at write (/home/joe/eclipseWorkspace/iD8266/node_modules/gulp-inline/node_modules/readable-stream/lib/_stream_readable.js:623:24)
at flow (/home/joe/eclipseWorkspace/iD8266/node_modules/gulp-inline/node_modules/readable-stream/lib/_stream_readable.js:632:7)
at Transform.pipeOnReadable (/home/joe/eclipseWorkspace/iD8266/node_modules/gulp-inline/node_modules/readable-stream/lib/_stream_readable.js:664:5)
joe@joes-HP-EliteBook-8470p ~/eclipseWorkspace/iD8266 $ |
Fixed. Looking at https://github.com/ashaffer/gulp-inline/blob/master/index.js#L50 gave me a clue where it was going wrong. This line of code exists to inline img tags and it doesn't like img tags that don't have a src attribute..in short, I broke this by way of my own broken invalid html markup. Fixed by changing:
to
..in one of my html docs |
In my case this problem begins with img with no src, but doesn't fix after adding this attribute, as if something has been broken in plugin after first wrong start. It takes place both on ubuntu 14.04 and windows 7. |
Sometimes have this error.
Fixed only after several remove/install node_modules, rebootings.
My gulpfile.js: https://github.com/g1un/amrest-app/blob/master/gulpfile.js
The text was updated successfully, but these errors were encountered: