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

TypeError: resultMap.eachMapping is not a function #97

Open
fabien-michel opened this issue Jul 10, 2019 · 5 comments · May be fixed by #102
Open

TypeError: resultMap.eachMapping is not a function #97

fabien-michel opened this issue Jul 10, 2019 · 5 comments · May be fixed by #102

Comments

@fabien-michel
Copy link

I'm not sure about the exact context, but since upgrading to 2.4.1 (from 2.3.1) we have this error:
TypeError: resultMap.eachMapping is not a function

Node 10
Gulp 3
gulp-sourcemaps 2.6.5

To fix the problem we have to force npm package to 2.3.x

@ZatolokinPavel
Copy link

This is not a solution! Sorcemap will become useless if the galp-include is connected before or after the sorcemap.

@coaperator
Copy link

I have the same problem
TypeError: resultMap.eachMapping is not a function

how to solve?

@6elkir
Copy link

6elkir commented Jan 19, 2021

I have the same problem

TypeError: resultMap.eachMapping is not a function

Need fix it!

@vrugtehagel
Copy link

vrugtehagel commented Sep 23, 2021

Here's a solution: simply downgrade to 2.3.1.

The problem lies in the fact that [email protected] uses [email protected] while [email protected] uses [email protected] (those are the two versions I tested, anyway). The source-map package uses promises in version 0.7.3 (the SourceMapConsumer returns one) but doesn't in version 0.5.7. gulp-include calls eachMapping on the result of new SourceMapConsumer(...), which clearly breaks when that returns a promise.

@callaginn
Copy link

Has anyone figured out how to fix this issue without downgrading? I'm using Gulp 4, so can't simply downgrade gulp-include to version 2.3.1 without even more stuff breaking.

Here's the type error I get whenever I try to compile:

TypeError: resultMap.eachMapping is not a function
    at processInclude (/Users/stephen/Sites/templates/twig-site/node_modules/gulp-include/index.js:206:39)
    at include (/Users/stephen/Sites/templates/twig-site/node_modules/gulp-include/index.js:58:26)
    at wrappedMapper (/Users/stephen/Sites/templates/twig-site/node_modules/map-stream/index.js:83:19)
    at Stream.stream.write (/Users/stephen/Sites/templates/twig-site/node_modules/map-stream/index.js:95:21)
    at DestroyableTransform.ondata (/Users/stephen/Sites/templates/twig-site/node_modules/readable-stream/lib/_stream_readable.js:619:20)
    at DestroyableTransform.emit (node:events:527:28)
    at DestroyableTransform.emit (node:domain:537:15)
    at addChunk (/Users/stephen/Sites/templates/twig-site/node_modules/readable-stream/lib/_stream_readable.js:291:12)
    at readableAddChunk (/Users/stephen/Sites/templates/twig-site/node_modules/readable-stream/lib/_stream_readable.js:278:11)
    at DestroyableTransform.Readable.push (/Users/stephen/Sites/templates/twig-site/node_modules/readable-stream/lib/_stream_readable.js:245:10)
[10:07:08] Finished 'scss' after 819 ms
[10:07:18] The following tasks did not complete: watch, <series>, <parallel>, js
[10:07:18] Did you forget to signal async completion?
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@dbisso dbisso linked a pull request Sep 9, 2022 that will close this issue
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 a pull request may close this issue.

6 participants