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

Unhelpful error message when 0.x @astrojs/mdx used with Astro 3 #8985

Closed
1 task
JoshuaKGoldberg opened this issue Nov 2, 2023 · 4 comments
Closed
1 task
Labels
needs response Issue needs response from OP

Comments

@JoshuaKGoldberg
Copy link
Contributor

Astro Info

Astro                    v3.4.2
Node                     v20.2.0
System                   macOS (arm64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             astro-konamimojisplosion
                         @astrojs/solid-js
                         @astrojs/prefetch
                         @astrojs/mdx

If this issue only occurs in one browser, which browser is a problem?

n/a

Describe the Bug

After upgrading all packages except @astrojs/mdx to the latest for Astro 3 (hooray! congrats again on the launch! 🥳), trying to visit or build a .mdx page with frontmatter yields:

[astro:jsx] Transform failed with 1 error:
/Users/josh/repos/dot-com/src/content/blog/binary-arithmetic/index.mdx:2:11: ERROR: Expected ";" but found ":"
file: /Users/josh/repos/dot-com/src/content/blog/binary-arithmetic/index.mdx:2:11

Expected ";" but found ":"
1  |  ---
2  |  description: "Just for fun, what if we represented binary values purely within TypeScript's logical type system?"
   |             ^
3  |  download: https://1drv.ms/p/s!AvUc1cvPrJnWvqNRDN6yLPZvYTb8KA?e=aNxTrY
4  |  pubDate: 2019-10-11

 error   Expected ";" but found ":"
  File:
    /Users/josh/repos/dot-com/src/content/blog/binary-arithmetic/index.mdx:2:11
  Code:
    1 | ---
    > 2 | description: "Just for fun, what if we represented binary values purely within TypeScript's logical type system?"
        |           ^
      3 | download: https://1drv.ms/p/s!AvUc1cvPrJnWvqNRDN6yLPZvYTb8KA?e=aNxTrY
      4 | pubDate: 2019-10-11
      5 | title: Binary Arithmetic in the TypeScript Type System
  Stacktrace:
Error: Transform failed with 1 error:
/Users/josh/repos/dot-com/src/content/blog/binary-arithmetic/index.mdx:2:11: ERROR: Expected ";" but found ":"
    at failureErrorWithLog (/Users/josh/repos/dot-com/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1649:15)
    at /Users/josh/repos/dot-com/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:847:29
    at responseCallbacks.<computed> (/Users/josh/repos/dot-com/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:703:9)
    at handleIncomingPacket (/Users/josh/repos/dot-com/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:762:9)
    at Socket.readFromStdout (/Users/josh/repos/dot-com/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:679:7)
    at Socket.emit (node:events:511:28)
    at addChunk (node:internal/streams/readable:332:12)
    at readableAddChunk (node:internal/streams/readable:305:9)
    at Readable.push (node:internal/streams/readable:242:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)

What's the expected result?

pls work :c

Aside: I tried astro.new for a bit but it didn't give the error I wanted 😞 sorry! But this was reported on Discord too: https://discord.com/channels/830184174198718474/1162386580548362344

Repro steps:

  1. Checkout https://github.com/JoshuaKGoldberg/dot-com/tree/694445d
  2. pnpm install
  3. pnpm build

Link to Minimal Reproducible Example

https://github.com/JoshuaKGoldberg/dot-com/tree/694445d (sorry)

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Nov 2, 2023
@matthewp
Copy link
Contributor

Hey @JoshuaKGoldberg sorry for not responding earlier. I see that the commit no longer exists. Are you still having this problem? If not can we close the issue? Thanks.

@matthewp matthewp added needs response Issue needs response from OP and removed needs triage Issue needs to be triaged labels Nov 17, 2023
@JoshuaKGoldberg
Copy link
Contributor Author

Oop, sorry, I don't know what force push I did to get rid of it 😅.

I'd assume the issue still exists but will probably be less relevant as time goes on. It was quite irritating to discover the hard way when upgrading.

@bluwy
Copy link
Member

bluwy commented Nov 27, 2023

Thanks for the issue. While I think it's nice to prevent hard breakage like these in the future, we don't have much bandwidth to fix this case at the moment. All packages should usually be upgraded to latest when upgrading Astro as well. And for that, #8525 may help with this. For now I'll close this issue.

@bluwy bluwy closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2023
@v11ncent
Copy link

v11ncent commented Jun 22, 2024

I had this same issue when attempting to rebuild my Astro site that wasn't touched for a year.

I ended up using npm update to update all my dependencies since I couldn't figure out what was wrong. The core dependency for Astro was being annoying and installing the older version 3.x so I uninstalled it and manually added the latest version using npm i [email protected] / npm i astro@latest.

I then went to rebuild it using npm run build, and it gave me the following error:

[vite]: Rollup failed to resolve import "sharp" from "C:/Users/Vince/Desktop/fun/Vince-Web-Designs/node_modules/astro/dist/assets/services/sharp.js".

I then installed Sharp using npm i sharp, and rebuilt my site. Now it works! 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs response Issue needs response from OP
Projects
None yet
Development

No branches or pull requests

4 participants