Skip to content

.textConverted needs to install the package encoding separately #412

Closed

Description

@motss

Why the package encoding is not part of node-fetch's dependencies to use .textConverted?

Activity

  1. TimothyGu commented on Mar 4, 2018

    @TimothyGu
    Collaborator

    It's intentional: we don't force people who don't use textConverted to install encoding. We should document this however.

  2. motss commented on Mar 5, 2018

    @motss
    Author

    Ya. A line or two stating this can be helpful! 👍

  3. TimothyGu commented on Mar 5, 2018

    @TimothyGu
    Collaborator

    @motss Would you be interested in creating a pull request? ☺️

  4. motss commented on Mar 6, 2018

    @motss
    Author

    @TimothyGu Sure thing. Will work on that probably on the weekend.

  5. added a commit that references this issue on Mar 9, 2018
  6. peterbakonyi05 commented on Apr 5, 2018

    @peterbakonyi05

    Please note that since encoding is not part of the dependencies by default, when using this package with webpack, without installing encoding, webpack will fail with the usual error message:

    WARNING in ./node_modules/cross-fetch/node_modules/node-fetch/lib/index.es.js
    Module not found: Error: Can't resolve 'encoding' in 'C:\git\halo.site\node_modules\cross-fetc
    h\node_modules\node-fetch\
    

    I think it would be nice to also add this to the README:
    When using node-fetch with webpack. You either need to install encoding or add IgnorePlugin

    new webpack.IgnorePlugin(/^encoding$/, /node-fetch/)
  7. itonics-tbeauvais commented on Aug 28, 2018

    @itonics-tbeauvais

    Somehow, using the nodeExternals() for the externals option in webpack found here https://www.npmjs.com/package/webpack-node-externals

  8. motss commented on Aug 28, 2018

    @motss
    Author

    I thought this had been fixed by one of the PRs. I can update the doc real quick with the findings from @peterbakonyi05 as well.

  9. motss commented on Aug 28, 2018

    @motss
    Author

    I've added briefly in the doc. Please help review #511. Thank you.

  10. bitinn commented on Nov 5, 2018

    @bitinn
    Collaborator

    I have added guideline to readme and link to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions