Skip to content

6.5.0 update error #215

Closed
Closed

Description

@woohyun1031

Describe the bug

Hi. I always use this library successfully. Thank you!

"After upgrading open-graph-scraper from version 6.3.2 to 6.5.0 in the current Next.js 14 project, a compilation error occurred during the build.
This issue was observed on both client and server components.
While tracing the error, it was identified that the problem originated in the 'lib/web/fetch/util.js' file, and it was noted that undici, a dependency of open-graph-scraper, was also updated.
Testing with another Next.js project revealed that the error started occurring from a specific version of open-graph-scraper onwards.
As a result, I downgraded back to the previously used version 6.3.2.
I'm having difficulty pinpointing the exact cause of this error, and I'm curious if you have any insights into why it might be happening.

Screenshots
스크린샷 2024-03-05 오후 1 04 41

Environment

  • OS: Mac M1 Pro
  • Node Version: v20.10.0
  • openGraphScraper Version: v6.5.0
  • Next.js: v14.0.1

Activity

  1. jshemas commented on Mar 6, 2024

    @jshemas
    Owner

    I don't see any errors when I build my master(6.5.0) branch using node v20.10.0. Can you make a example repo that has the problem?

  2. giyeol commented on Mar 6, 2024

    @giyeol

    I have the same problem, and using version v20.11.1.

  3. giyeol commented on Mar 6, 2024

    @giyeol

    I have similar problem, and using version v20.11.1.

    ./node_modules/.pnpm/undici@6.7.0/node_modules/undici/lib/web/fetch/util.js
    Module parse failed: Unexpected token (608:63)
    |             // 5. If object is not a default iterator object for interface,
    |             //    then throw a TypeError.
    >             if (typeof this !== "object" || this === null || !(#target in this)) {
    |                 throw new TypeError(`'next' called on an object that does not implement interface ${name} Iterator.`);
    |             }
  4. giyeol commented on Mar 6, 2024

    @giyeol

    I have the same problem, and using version v20.11.1.

    It's probably an issue with the undici package. I fixed it with the following modification.

    // package.json
      "pnpm": {
        "overrides": {
          "open-graph-scraper>undici": "6.6.2"
        }
      }
    
  5. jshemas commented on Mar 6, 2024

    @jshemas
    Owner

    @giyeol @woohyun1031 it looks like that line was last changed in nodejs/undici#2743, which was part of undici@6.7.0. I would recommend opening a issue/pull request with undici. I'm still not able to reproduce the problem.

  6. v9ai commented on Mar 8, 2024

    @v9ai

    having the same error

    image
  7. jshemas commented on Mar 16, 2024

    @jshemas
    Owner

    It looks like the undici team is aware of the issue -> nodejs/undici#2954 and are pushing to fix this in nextjs. Closing this for now since there isn't a way this can be fixed in OGS, please follow up with the nextjs team.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions