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

fix: Missing Sharp error during build #8049

Closed
wants to merge 10 commits into from
Closed

fix: Missing Sharp error during build #8049

wants to merge 10 commits into from

Conversation

rishi-raj-jain
Copy link
Contributor

@rishi-raj-jain rishi-raj-jain commented Aug 13, 2023

fix #7966

@changeset-bot
Copy link

changeset-bot bot commented Aug 13, 2023

⚠️ No Changeset found

Latest commit: 7e4454d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Aug 13, 2023
@rishi-raj-jain
Copy link
Contributor Author

rishi-raj-jain commented Aug 13, 2023

So I took a look at Next.js's implementation and they do just the same (of what you had done @Princesseuh)

The missing piece is just to add a warning to say that sharp is missing. I don't think there's any other way around with pnpm.

Do you want me to add those warnings?
Screenshot 2023-08-13 at 11 44 45 PM
Screenshot 2023-08-13 at 11 44 52 PM

Happy to contribute a doc page as well.

@rishi-raj-jain rishi-raj-jain marked this pull request as draft August 13, 2023 18:15
@Princesseuh
Copy link
Member

Next (and we) did this because Sharp was optional, which is not the case in Astro 3.0.

What's the reason it cannot be used directly like a normal dependency? Does it require hoisting?

@Princesseuh
Copy link
Member

Superseded by #8128, it seems like bundling JavaScript nonsense is causing us to not be able to simply import Sharp 😔

@rishi-raj-jain
Copy link
Contributor Author

@Princesseuh

Ah yeah, did saw the same online that pnpm and sharp don't go well together. Great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants