posthtml-modules icon indicating copy to clipboard operation
posthtml-modules copied to clipboard

Maximum call stack size exceeded when passing content to nested module.

Open deivse opened this issue 3 years ago • 0 comments

I'm using posthtml-modules v0.9.0 with gulp. I have the following setup:

Main page:

<module href="modules/moduleA.html>
    ...other stuff...
</module>

module A:

<div> 
    <module href="moduleB.html">
        <content></content>
    </module>
</div>

module B:

<div>
   <stuff...>
      <content></content>
   </stuff...>
</div>

Whenever I try doing anything like this, where I pass content to a module from within another module, I get the following error:

[14:24:01] Error in plugin "gulp-posthtml"
Message:
    Maximum call stack size exceeded
Details:
    domainEmitter: [object Object]
    domainThrown: false

Stack:
RangeError: Maximum call stack size exceeded
    at .../node_modules/posthtml-modules/index.js:81:58
    at .../node_modules/posthtml/lib/api.js:91:45
    at traverse (.../node_modules/posthtml/lib/api.js:105:26)
    at traverse (.../node_modules/posthtml/lib/api.js:105:17)
    at traverse (.../node_modules/posthtml/lib/api.js:105:17)
    at traverse (.../node_modules/posthtml/lib/api.js:105:17)
    at traverse (.../node_modules/posthtml/lib/api.js:105:17)
    at traverse (.../node_modules/posthtml/lib/api.js:105:17)
    at traverse (.../node_modules/posthtml/lib/api.js:105:17)
    at traverse (.../node_modules/posthtml/lib/api.js:105:17)

I might be doing something wrong, but I couldn't find what that could be despite studying the docs and googling for quite a long time, so I'm starting to think this might be a bug.

deivse avatar Aug 27 '22 12:08 deivse