Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

SyntaxError: 'undefined' is not an object (evaluating 'declarations.forEach') #48

Closed
stevenvachon opened this issue Apr 8, 2014 · 9 comments

Comments

@stevenvachon
Copy link
Contributor

var less = {
    relativeUrls: false,
    rootpath: appRoot,
    postProcessor: function(styles){ console.log(styles); return myth(styles) }
};

Logging out styles gives me accurate CSS, and simply doing return styles works fine. Am I missing something somewhere?

Here is the full error:

SyntaxError: 'undefined' is not an object (evaluating 'declarations.forEach')
in init.less 
http://localhost:8000/vendors/myth/myth.js:10181:11
forEach@[native code]
http://localhost:8000/vendors/myth/myth.js:10180:29
forEach@[native code]
visit@http://localhost:8000/vendors/myth/myth.js:10171:21
vars@http://localhost:8000/vendors/myth/myth.js:10054:10
use@http://localhost:8000/vendors/myth/myth.js:10879:5
plugin@http://localhost:8000/vendors/myth/myth.js:41:9
use@http://localhost:8000/vendors/myth/myth.js:10879:5
myth@http://localhost:8000/vendors/myth/myth.js:28:9
postProcessor@http://localhost:8000/:27:49
postProcessCSS@http://localhost:8000/vendors/less.js/dist/less-1.7.0.js:7401:41
http://localhost:8000/vendors/less.js/dist/less-1.7.0.js:7895:36
http://localhost:8000/vendors/less.js/dist/less-1.7.0.js:7796:29
finish@http://localhost:8000/vendors/less.js/dist/less-1.7.0.js:696:36
run@http://localhost:8000/vendors/less.js/dist/less-1.7.0.js:6284:29
parse@http://localhost:8000/vendors/less.js/dist/less-1.7.0.js:702:25
http://localhost:8000/vendors/less.js/dist/less-1.7.0.js:7793:40
http://localhost:8000/vendors/less.js/dist/less-1.7.0.js:7751:21
handleResponse@http://localhost:8000/vendors/less.js/dist/less-1.7.0.js:7676:21
doXHR@http://localhost:8000/vendors/less.js/dist/less-1.7.0.js:7696:23
loadFile@http://localhost:8000/vendors/less.js/dist/less-1.7.0.js:7745:10
loadStyleSheet@http://localhost:8000/vendors/less.js/dist/less-1.7.0.js:7769:13
loadStyleSheets@http://localhost:8000/vendors/less.js/dist/less-1.7.0.js:7809:23
refresh@http://localhost:8000/vendors/less.js/dist/less-1.7.0.js:7886:20
http://localhost:8000/vendors/less.js/dist/less-1.7.0.js:7912:13
global code@http://localhost:8000/vendors/less.js/dist/less-1.7.0.js:7921:3
@ianstormtaylor
Copy link
Contributor

hmm, hard to tell. i'd be curious to know what console.log(myth(styles)) returns

@stevenvachon
Copy link
Contributor Author

It doesn't log anything because of the error.

@ianstormtaylor
Copy link
Contributor

hopefully fixed in 1.0.0, let me know if not

@stevenvachon
Copy link
Contributor Author

Still not working.

@stevenvachon
Copy link
Contributor Author

The comment in this block is what throws the error:

@keyframes section-intro-children
{
    0%   { opacity:0 }
    25%  { opacity:0 }  /* simulates a delay */
    100% { opacity:1 }
}

With the comment removed, it parses without error.

@MoOx
Copy link
Contributor

MoOx commented Jul 27, 2014

It's not the same issue at all.
Reported here reworkcss/rework-vars#32

@MoOx
Copy link
Contributor

MoOx commented Jul 27, 2014

Fixed here reworkcss/rework-vars#33
Hopefully released soon (as a rework-vars update, so you will just need to delete & reinstall myth, or run npm update myth (not sure if this last one works, I never understand what npm update does ^^))

@stevenvachon
Copy link
Contributor Author

Thanks!

@MoOx
Copy link
Contributor

MoOx commented Jul 28, 2014

The issue came from the rework-visit helper, I'll try to fix than asap.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants