Skip to content
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

Update inliner.js #203

Closed
wants to merge 1 commit into from
Closed

Conversation

hassan-alnator
Copy link

To Use indexOf on a string not a buffer

 To Use indexOf on a string not a buffer
@GoalSmashers
Copy link
Contributor

@hassan-alnator what's a scenario when this can happen?

@hassan-alnator
Copy link
Author

i keep getting an error (data has no method 'indexOf) so i did a
console.log(data)
and it was a buffer so i added toString to it and then it worked fine.

regards,

On Wed, Jan 1, 2014 at 6:30 PM, Goal Smashers Dev Team <
notifications@github.com> wrote:

@hassan-alnator https://github.com/hassan-alnator what's a scenario
when this can happen?


Reply to this email directly or view it on GitHubhttps://github.com//pull/203#issuecomment-31424501
.

@hassan-alnator
Copy link
Author

nextStart = data.indexOf('@import', cursor);

TypeError: Object

data has no method 'indexOf'
at Object.Inliner.process (/home/hasan/Projects/getelegant/node_modules/clean-css/lib/imports/inliner.js:20:24)
at Object.inlineImports as 0
at replace (/home/hasan/Projects/getelegant/node_modules/clean-css/lib/clean.js:49:21)
at Object.minify (/home/hasan/Projects/getelegant/node_modules/clean-css/lib/clean.js:82:7)
at Interceptor. (/home/hasan/Projects/getelegant/lib/interceptors/render.js:65:60)
at /home/hasan/Projects/getelegant/node_modules/elegant-sync/index.js:33:13
at fs.js:266:14
at Object.oncomplete (fs.js:107:15)

@GoalSmashers
Copy link
Contributor

Quite likely it means a buffer is passed into the library since inliner is the first preprocessor. We need to move your change to CleanCSS#process and add a test case. Can you handle it?

GoalSmashers pushed a commit that referenced this pull request Jan 3, 2014
@GoalSmashers
Copy link
Contributor

@hassan-alnator It has been addressed in c36506a - expect 2.0.5 very soon.

@GoalSmashers
Copy link
Contributor

2.0.5 is out. All should be OK now.

GoalSmashers pushed a commit that referenced this pull request Jan 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants