Skip to content

Fails to run with older versions of ESBuild #205

Closed

Description

@nayaabkhan

Error

UnknownEsbuildError: Error: Build failed with 1 error:
[redacted]/node_modules/esbuild/lib/main.js:239:12: error: Invalid option in build() call: "jsx"

Possible cause

@contentlayer/core lists an old version in peerDependencies:

"esbuild": "0.11.x || 0.12.x || 0.13.x",

It uses the jsx option which was added in ESBuild v0.12.1:

Proposed fix

https://github.com/contentlayerdev/contentlayer/pull/204/files

Activity

  1. schickling commented on Apr 30, 2022

    @schickling
    Collaborator

    Thanks for opening this issue. Can you please provide a reproduction repo with instructions how to reproduce the problem you're experiencing? Thank you!

  2. nayaabkhan commented on May 1, 2022

    @nayaabkhan
    ContributorAuthor

    Hey @schickling, here's the reproduction repo forked from the https://github.com/contentlayerdev/next-contentlayer-example.

    There are two way this can be reproduced:

    1. By adding another package that requires an older version of esbuild: nayaabkhan/next-contentlayer-example@0471b02
    2. By using overrides to manually set a version: nayaabkhan/next-contentlayer-example@fe9b5c4
  3. added this to the 0.2.5 milestone on May 11, 2022
  4. schickling commented on May 11, 2022

    @schickling
    Collaborator

    This should be addressed with the 0.2.5 release. 🎉

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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions