-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
🐛 BUG: Astro packages don't properly define their dependencies (Yarn PnP incompatibilty) #1676
Comments
I looked into this a bit further and was able to get astro to start after adding a lot of missing dependencies. In particular, these
Also needed to update the "dependencies": {
"@astrojs/renderer-react": "^0.2.2",
"@snowpack/plugin-postcss": "^1.4.3",
"@snowpack/plugin-sass": "^1.4.0",
"astring": "^1.7.5",
"autoprefixer": "^10.3.7",
"estree-util-value-to-estree": "^1.3.0",
"node-fetch": "^3.0.0",
"object-assign": "^4.1.1",
"postcss": "^8.3.11",
"prismjs": "^1.25.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"shorthash": "^0.0.2"
} Now there's this error:
|
I created a repo at https://github.com/andreialecu/astro-yarn3-pnp with my initial research into this. It includes all missing dependencies (I added them manually), and shows the ESM error. |
Thanks for digging into this! Many of these issues should be fixed in #1406. |
Minor update on this: I’ve been testing |
Confirmed issues in astro@next on yarn |
Just confirmed I'm still seeing this with yarn Looks like https://github.com/yarnpkg/berry/pull/2161 is merged in now. I'm not super familiar with the inner workings of the different package managers, is this something we should fix on our end or is it blocked on a |
Astro monorepo is now on pnpm, so this should be mostly resolved. However, |
@FredKSchott, I think this has been incorrectly closed. pnpm is separate from yarn's Plug'n'Play ( I have this issue, and need to add extra dependencies with |
@MrAlex94 we recently fully support projects without shamefully-hoist, which is a common issue with strict dependency installations like pnpm and yarn pnp. Are there anything else specific that we didn't cover? I might be better to create a separate issue for. |
What package manager are you using?
yarn 3.1
What operating system are you using?
Mac
Describe the Bug
I've been experimenting with Astro and Yarn 3 in PnP mode.
PnP mode is strict about packages requiring dependencies, and it does not allow them to be hijacked from other packages.
Astro is doing some things wrong in this regard, for example it uses
fast-glob
but it's nowhere inpackage.json
. I suspect thepnpm
package manager will also have problems with this.Steps to Reproduce
fast-glob
is indeed imported here:https://github.com/snowpackjs/astro/blob/b1b564d03d09cee63e072397dfb2ab1a1f59b346/packages/astro/src/check.ts#L5
But it's not defined in any
package.json
.This is a correctness issue. See: https://yarnpkg.com/advanced/rulebook/#packages-should-only-ever-require-what-they-formally-list-in-their-dependencies
Link to Minimal Reproducible Example (Optional)
No response
The text was updated successfully, but these errors were encountered: