Update preact.mdx#6558
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Hello! Thank you for opening your first PR to Astro’s Docs! 🎉 Here’s what will happen next:
|
Important update, a useful warning for docsHello, as I was setting up a new astro project, I had to execute But after successfully adding preact astro integration using
$ pnpm add --save lucide-preact
WARN Moving astro that was installed by a different package manager to "node_modules/.ignored"
WARN Moving preact that was installed by a different package manager to "node_modules/.ignored"
EPERM EPERM: operation not permitted, rename 'C:\Users\Utilisateur\my_project_here\node_modules\astro' -> 'C:\Users\Utilisateur\my_project_here\node_modules\.ignored\astro'
Now, to solve that, I had to roll back the astro preact integration installation, by :
rm -fr ./node_modules/
pnpm remove @astrojs/preact preact
import tailwind from "@astrojs/tailwind";
import icon from "astro-icon";
import { defineConfig } from "astro/config";
import preact from "@astrojs/preact";
// https://astro.build/config
export default defineConfig({
site: "https://astro-moon-landing.netlify.app/",
integrations: [tailwind(), icon(), preact({ compat: true })]
});
import tailwind from "@astrojs/tailwind";
import icon from "astro-icon";
import { defineConfig } from "astro/config";
// https://astro.build/config
export default defineConfig({
site: "https://astro-moon-landing.netlify.app/",
integrations: [tailwind(), icon()]
});
pnpm add @astrojs/preact preact
pnpm add @preact/compat
pnpm add lucide-preactNote that after that, I tested creating a bare new astro project, to try and use Utilisateur@Utilisateur-PC MINGW64 ~/pr_test/retrograde-ring
$ pnpm exec astro add preact
- Resolving packages...
√ Resolving packages...
05:03:04
Astro will run the following command:
If you skip this step, you can always run it yourself later
╭──────────────────────────────────────────────────╮
│ pnpm add @astrojs/preact@^3.1.0 preact@^10.19.3 │
╰──────────────────────────────────────────────────╯
? Continue? » (Y/n)Y
√ Continue? ... yes
- Installing dependencies...
√ Installing dependencies...
05:03:25
Astro will make the following changes to your config file:
╭ astro.config.mjs ─────────────────────────────╮
│ import { defineConfig } from 'astro/config'; │
│ │
│ import preact from "@astrojs/preact"; │
│ │
│ // https://astro.build/config │
│ export default defineConfig({ │
│ integrations: [preact()] │
│ }); │
╰───────────────────────────────────────────────╯
? Continue? » (Y/n)Y
√ Continue? ... yes
05:03:32
success Added the following integration to your project:
- @astrojs/preact
05:03:32
Astro will make the following changes to your tsconfig.json:
╭ tsconfig.json ─────────────────────────────╮
│ { │
│ "extends": "astro/tsconfigs/strictest", │
│ "compilerOptions": { │
│ "jsx": "react-jsx", │
│ "jsxImportSource": "preact" │
│ } │
│ } │
╰────────────────────────────────────────────╯
? Continue? » (Y/n)Y
√ Continue? ... yes
05:03:34
success Successfully updated TypeScript settings
Utilisateur@Utilisateur-PC MINGW64 ~/pr_test/retrograde-ring
$ pnpm add --save preact @preact/compat lucide-preact
Progress: resolved 0, reused 1, downloaded 0, added 0
Progress: resolved 3, reused 3, downloaded 0, added 0
Progress: resolved 209, reused 185, downloaded 0, added 0
Packages: +2
++
Progress: resolved 479, reused 444, downloaded 0, added 1
Progress: resolved 479, reused 444, downloaded 0, added 2
Progress: resolved 479, reused 444, downloaded 0, added 2, done
dependencies:
+ @preact/compat 17.1.2
+ lucide-preact 0.314.0
Done in 6.9s
The astro version I used at the time of my test is $ cat package.json
{
"name": "retrograde-ring",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"astro": "^4.2.4"
}
}
My guessed explanation is that using So I think it would be useful to add a warning about that point in the astro docs, for the |
415e87a to
fc0ccee
Compare
|
just squashed my commits |
fix doc typo: use 'pnpm dlx astro add preact' to run astro cli, instead of 'pnpm astro add preact' fix(pnpm astro cli exec. doc.): add a warning into the integration guide fix(pnpm astro cli exec. doc.): change pnpm dlx to pnpm exec
ab466c3 to
77b6536
Compare
|
Hi! Thank you for your thoroughness here! Can you please file a docs Issue about this instead, so that others can examine what's happening here? This is not something reported by anyone else, so I'd like others to be able to verify and figure out what is happening so we can decide what, if anything, needs to change in docs. |
Thank you for your quick reply! I will do that with pleasure :) , thank you all astro team for that awesome project! :) |
|
@sarah11918 there you go : withastro/astro#9844 |
* Update add-content-collections.mdx Just for Lunaria * Update 2.mdx Update with PR #6558 * Update 1.mdx Update with PR #6571 * Just for lunaria Update 3.mdx Update with PR 6544 for lunaria * Update error-reference.mdx With PR #6623 * Update astro-glob-no-match.mdx Update with PR #6623 * Create i18n-not-enabled.mdx * Add i18n-not-enabled.mdx With PR #6623 * Create missing-index-for-internationalization.mdx * Add missing-index-for-internationalization.mdx With PR #6623 * Update manual.mdx With PR #6653 * Update prefetch.mdx Update with PR #6573 * Update tailwind.mdx Update with PR #6662 * Update alpinejs.mdx Update with #6534 * Update src/content/docs/fr/install/manual.mdx Co-authored-by: Thomas Bonnet <thomasbnt@protonmail.com> * Update src/content/docs/fr/guides/integrations-guide/alpinejs.mdx Co-authored-by: Thomas Bonnet <thomasbnt@protonmail.com> * Update src/content/docs/fr/reference/errors/missing-index-for-internationalization.mdx Co-authored-by: voxel!() <voxelmc@hotmail.com> * Update src/content/docs/fr/reference/errors/i18n-not-enabled.mdx Co-authored-by: voxel!() <voxelmc@hotmail.com> * Update src/content/docs/fr/reference/errors/astro-glob-no-match.mdx Co-authored-by: voxel!() <voxelmc@hotmail.com> --------- Co-authored-by: Thomas Bonnet <thomasbnt@protonmail.com> Co-authored-by: voxel!() <voxelmc@hotmail.com> Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>
fix doc typo: use
pnpm exec astro add preactto run astro cli, instead ofpnpm astro add preactDescription (required)
Indeed, if you run
pnpm astro add preact, you get the following error :Related issues & labels (optional)
Environment
Gitbash for windows,astro4.2.4pnpm8.14.1