onwidget / astrowind Goto Github PK
View Code? Open in Web Editor NEW⭕️ AstroWind: A free template using Astro 4.0 and Tailwind CSS. Astro starter theme.
Home Page: https://astrowind.vercel.app
License: MIT License
⭕️ AstroWind: A free template using Astro 4.0 and Tailwind CSS. Astro starter theme.
Home Page: https://astrowind.vercel.app
License: MIT License
after running
npx create-sst
per https://docs.astro.build/en/guides/deploy/sst/
I accepted all default answers and then attempted to run
npm run build
I get the following error:
officium:EvonyTips_v2 luke$ npm run build
> @onwidget/[email protected] build
> astro build
02:04:28 PM [content] Unsupported file types found. Prefix with an underscore (`_`) to ignore:
- markdown-elements-demo-post.mdx
02:04:28 PM [content] Types generated 358ms
02:04:28 PM [build] output target: server
02:04:28 PM [build] deploy adapter: astro-sst/lambda
02:04:28 PM [build] Collecting build info...
02:04:28 PM [build] Completed in 380ms.
02:04:28 PM [build] Building server entrypoints...
[vite:import-glob] Invalid glob: "~/assets/images/**" (resolved: "~/assets/images/**"). It must start with '/' or './'
file: /Users/luke/src/astro/EvonyTips_v2/src/utils/images.ts
error Invalid glob: "~/assets/images/**" (resolved: "~/assets/images/**"). It must start with '/' or './'
File:
/Users/luke/src/astro/EvonyTips_v2/src/utils/images.ts
Stacktrace:
Error: Invalid glob: "~/assets/images/**" (resolved: "~/assets/images/**"). It must start with '/' or './'
at toAbsoluteGlob (file:///Users/luke/src/astro/EvonyTips_v2/node_modules/vite/dist/node/chunks/dep-c167897e.js:39733:11)
at async Promise.all (index 0)
at async file:///Users/luke/src/astro/EvonyTips_v2/node_modules/vite/dist/node/chunks/dep-c167897e.js:39529:31
at async Promise.all (index 0)
at async parseImportGlob (file:///Users/luke/src/astro/EvonyTips_v2/node_modules/vite/dist/node/chunks/dep-c167897e.js:39543:13)
at async transformGlobImport (file:///Users/luke/src/astro/EvonyTips_v2/node_modules/vite/dist/node/chunks/dep-c167897e.js:39563:21)
at async Object.transform (file:///Users/luke/src/astro/EvonyTips_v2/node_modules/vite/dist/node/chunks/dep-c167897e.js:39370:28)
at async transform (file:///Users/luke/src/astro/EvonyTips_v2/node_modules/rollup/dist/es/shared/node-entry.js:23363:16)
at async ModuleLoader.addModuleSource (file:///Users/luke/src/astro/EvonyTips_v2/node_modules/rollup/dist/es/shared/node-entry.js:23569:30)
officium:EvonyTips_v2 luke$
I freshly cloned the repository yesterday and have only just started exploring Astro. I tried to keep things fairly minimal to make sure I wasn't introducing the error by conflicting integrations.
officium:EvonyTips_v2 luke$ cat astro.config.mjs
import { defineConfig } from "astro/config";
import aws from "astro-sst/lambda";
export default defineConfig({
output: "server",
adapter: aws(),
});
note, updated the stack trace because I had forgotten I had edited src/utils/images.ts in an attempt to fix this myself. The current stack trace reflects the error with the default content in src/utils/images.ts
Hi everyone, I'm still new to Astro in general and came to the following issue. I downloaded the code in Zip file, extracted them and ran the following as instructed in the README.
And got the following error:
> @onwidget/[email protected] dev
> astro dev
dyld: lazy symbol binding failed: Symbol not found: _pthread_jit_write_protect_supported_np
Referenced from: /Volumes/DATA/Astro/astrowind/node_modules/sharp/build/Release/../.././vendor/8.13.3/darwin-x64/lib/libvips-cpp.42.dylib
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: _pthread_jit_write_protect_supported_np
Referenced from: /Volumes/DATA/Astro/astrowind/node_modules/sharp/build/Release/../.././vendor/8.13.3/darwin-x64/lib/libvips-cpp.42.dylib
Expected in: /usr/lib/libSystem.B.dylib
/var/folders/p1/k78b7zpd401fqcvhv6jx8w2r0000gn/T/dev-f33a7221.sh: line 1: 10857 Abort trap: 6 astro dev
Though it went smoothly on the previous release, wondering if anyone could point me on how to fix them.
Thanks,
Markdown is not loaded with the tags such as H1,H2 or list
i get an error like this, whenever i try to build.
Error: Rollup failed to resolve import "web-streams-polyfill" from `"node_modules/@astrojs/image/dist/utils/workerPool.js"`.
Hi All!
I've been using your template and I'm really enjoying it so far. I've ran into a small issue and I hope that anyone can help me out :)
I've cloned your repository and deployed it through Vercel. When I enter the production URL, everything seems to work fine on the / endpoint. If I try to enter the /blog endpoint, I'll receive a 500 HTTP error.
Here are the steps that I took from cloning the project to deployment.
Git clone [[email protected]:codewithdary/cdw-astro-test.git](mailto:[email protected]:codewithdary/cdw-astro-test.git)
cd cdw-astro-test
NPM installation
npm install
npm run build
npm run dev
Accessed website through localhost where everything seem to work fine, even the /blog endpoint.
http://localhost:3000/
Deployment through Vercel
npm install @astrojs/vercel
Added the following in my astro.config.mjs file
import { defineConfig } from 'astro/config';
import vercel from '@astrojs/vercel/serverless';
export default defineConfig({
output: 'server',
adapter: vercel(),
});
Added new files to Git
git add astro.config.mjs
git commit -m “Added Vercel”
git push
Installed Vercel CLI
npm i -g vercel
vercel
Configuration through Vercel CLI
? Set up and deploy “~/Desktop/workspace/cdw-astro-test”? [Y/n] y
? Which scope do you want to deploy to? codewithdary
? Link to existing project? [y/N] n
? What’s your project’s name? cdw-astro-test
? In which directory is your code located? ./
? Want to modify these settings? [y/N] N
Deployment was successful. If I try to access the page through my production URL, the homepage works fine, but once I click on the /blog endpoint in the navigation, I’ll receive the following URL error:
cdw-astro-test-kgybbvmqs-codewithdary.vercel.app is currently unable to handle this request.
HTTP ERROR 500
Can someone please guide me through this issue? The link to my GitHub repository can be found right here.
Hey guys,
I'm creating a blog with this template and I would like to know how to add the same posts in different languages.
When installing Astrowind I got a couple of warnings from NPM. Something to look into or is this ok?
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: Use your platform's native performance.now() and performance.timeOrigin.
npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/address'
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
Originally posted by gangajamuna January 6, 2023
Hello, I'm trying to use the Astro wind theme. When I run dev everything works as expected however when I try to run the build this error is thrown:
throw new Error(`[astro-icon] Unable to load icon "${name}"!
Error: [astro-icon] Unable to load icon "tabler:info-square"!
Error: Unknown builtin plugin "cleanupIDs" specified.
I'm unable to preview the build and running localhost:3000 results in 404 not found.
When I remove "astro-icon": "^0.8.0" from project it is working.
Can someone explain to me what is happening here and how I might resolve this?
Thank you!
Hello, there seems to be a problem with the cumulative layout shift when using the theme with the latest Astro version 2.0.6. I tested it with Astro version 2.0.2, there is no problem. The following picture shows the problems, I haven't changed anything (just cloned and then uploaded the created files from the /dist directory).
hi, i just discover and fork this repo. i think "astrowind" is the best solution for landing and blog post static website.
i want to create a new routes "/organisations"
│ ├── pages/
│ | ├── [...blog]/
| | ├── [...page].astro
| | └── [slug].astro
│ | ├── [...organisations]/
| | ├── [...page].astro
| | └── [slug].astro
when i created these files and trying to check the route . i have a error .
" getstaticPaths route pattern matched but no matching static path found (/organisations)
thank for your anwser .
Just adding a simple script tag which logs Hello to a page gives this error:
error Could not import `/src/pages/contact-us.astro?astro&type=script&index=0&lang.ts`.
Hint:
This is often caused by a typo in the import path. Please make sure the file exists.
Stacktrace:
Error: failed to load module for ssr: /src/pages/contact-us.astro?astro&type=script&index=0&lang.ts
at instantiateModule (file:///D:/DCS%20Projects/Local/astrowind/node_modules/vite/dist/node/chunks/dep-5605cfa4.js:53281:15)
This is the .astro file for the page:
---
import { SITE } from '~/config.mjs';
import { getCanonical, getHomePermalink } from '~/utils/permalinks';
import Layout from '~/layouts/PageLayout.astro';
import Breadcrumbs from '~/components/widgets/Breadcrumbs.astro';
import Title from '~/components/widgets/Title.astro';
const {title = 'Contact Us'} = Astro.props;
const meta = {
title: title + ' - ' + SITE.title,
description: SITE.description,
canonical: getCanonical(getHomePermalink()),
};
---
<Layout {meta}>
<Breadcrumbs />
<Title title={title}/>
<p class="font-light text-center text-gray-500 dark:text-gray-400 sm:text-xl">We’re here to help! Tell us what you’re looking for and we’ll get back to you as soon as possible.</p>
</Layout>
<script>
console.log("Test");
</script>
If I remove the script tag at the end the same page loads fine without any errors
Hi,
First, thank you for this great template, awesome work!
I recently noticed that on Firefox mobile (v89.1.1), if I tap the "Learn more" button on the homepage, the scroll does not work well.
It scrolls the page in a way that the anchor is at the bottom of the page instead at the top.
This might be a Firefox bug, I don't know, just wanted to ask if you guys know a fix or workaround for this.
I deploye it to cloudflare,through it display sucss , I can’t open the site. I tried 3 times and don't know why...
Success: Finished cloning repository files
No build command specified. Skipping build step.
Note: No functions dir at /functions found. Skipping.
Validating asset output directory
Deploying your site to Cloudflare's global network...
Uploading... (99/99)
✨ Success! Uploaded 0 files (99 already uploaded) (0.42 sec)
✨ Upload complete!
Success: Assets published!
Success: Your site was deployed!
Deploying your site to Cloudflare's global network...
Uploading... (99/99)
✨ Success! Uploaded 0 files (99 already uploaded) (0.42 sec)
✨ Upload complete!
Back in December, I used this template to setup a simple site. Back then, the navbar elements were all nicely lined up on the right hand side of the top navbar. Now, they seems to be kinda in the center and it just doesn't look as clean.
Here is an example of what it looks like now with the navbar just not looking quite right:
Hi, I generated a repo from this template last week and saw that there have been a lot of nice updates since then. Is there any way to keep my "fork" up to date with the development?
I tried adding this repo as a second remote and then fetching and merging it but it does not seem to work.
fatal: refusing to merge unrelated histories
https://docs.astro.build/en/guides/rss/#including-full-post-content
I tried to use post.Content but it didn't work. How should I include the full post in the RSS feed?
There are many style problems displayed in browsers with lower versions, or the white screen is not displayed, etc.
I try to deploy astrowind on Vercel but i got this error.
error Failed to resolve entry for package "astro-compress". The package may have incorrect main/module/exports specified in its package.json.
It's common for blogs to feature social sharing buttons for some of the popular mediums and show them on each blog post (at the top, bottom, or other layout options).
Hi! I am curious if this template can be deployed on GitHub pages? I know that GitHub Pages only supports static
and not SSR (server
) rendering. I also see that this template has the static
option set so I would assume it would work but wanted to confirm here.
In MetaTags.asto use SITE.splitbeeAnalytics
{SITE.splitbeeAnalytics?.enabled && <SplitbeeAnalytics {...SITE.splitbeeAnalytics} />}
but in config.mjs is not declared
Hello, thank you so much for developing this wonderful theme.
I will tell you that I detected one problem in touching this theme.
The following error occurs when CJK language keywords are entered for "tags" in markdown files.
※CJK: Chinese、Japanese、Korean
/
├── src/
│ ├── data/
| | └── posts/
| | ├── post-slug-1.md
error Expected "tag" to match "[^\/#\?]+?", but got ""
TypeError: Expected "tag" to match "[^\/#\?]+?", but got ""
at Object.generate (.\astrowind-main\node_modules\path-to-regexp\dist\index.js:229:27)
at file://astrowind-main/node_modules/astro/dist/core/render/paginate.js:41:35
at Array.map (<anonymous>)
at paginateUtility (file://astrowind-main/node_modules/astro/dist/core/render/paginate.js:20:48)
at ./astrowind-main/src/pages/[...tags]/[tag]/[...page].astro:1:3
at Array.map (<anonymous>)
at Module.getStaticPaths (./astrowind-main/src/pages/[...tags]/[tag]/[...page].astro:1:3)
at async callGetStaticPaths (file://astrowind-main/node_modules/astro/dist/core/render/route-cache.js:20:18)
at async getParamsAndProps (file://astrowind-main/node_modules/astro/dist/core/render/core.js:22:25)
at async matchRoute (file://astrowind-main/node_modules/astro/dist/vite-plugin-astro-server/index.js:171:33)
0.2.0
No
Hello, I am using astrowind
for a project. I had a question. how can i change the path of a post from /some-post
to /blog/2022/08/11/some-post
. to put the post date in the path. Thanks
`X [ERROR] No loader is configured for ".node" files: node_modules/.pnpm/@[email protected]/node_modules/@napi-rs/pinyin-win32-x64-msvc/pinyin.win32-x64-msvc.node
node_modules/.pnpm/@[email protected]/node_modules/@napi-rs/pinyin/index.js:63:36:
63 │ nativeBinding = require('@napi-rs/pinyin-win32-x64-msvc')
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
03:41:42 PM [astro] update D:/websites/astrowind/.astro/types.d.ts
03:41:42 PM [content] Types generated
D:\websites\astrowind\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:1636
let error = new Error(`${text}${summary}`);
^
Error: Build failed with 1 error:
node_modules/.pnpm/@[email protected]/node_modules/@napi-rs/pinyin/index.js:63:36: ERROR: No loader is configured for ".node" files: node_modules/.pnpm/@[email protected]/node_modules/@napi-rs/pinyin-win32-x64-msvc/pinyin.win32-x64-msvc.node`
In order to continuously optimize and fix bugs, we may need to constantly synchronize the latest version and git commits
Hi
Thanks for the great theme.
I have noticed that the tag and category Canonical links are incorrect. They are https://sitename/category-categoryname instead of https://sitename/category/gategoryname (the canonical tag links are the same). So it looks like the theme is stripping the / after category and replacing it with a -.
Thanks
Robert
I found that there are several branches now, and they are still iterating frequently
I'm having a heck of a time integrating netlify-cms.
I've got it working now but I cannot get it to display uploaded images from the public folder. Is there something else I need to do? I tried making some changes to the glob in images.ts but nothing seemed to work. Any direction appreciated.
Example - if I change the image path in one of the placeholder blog posts from
image: ~/assets/images/stickers.jpg
to
image: public/box.jpg
No image displays. The image div never appears and there are no build or console errors. Thanks.
Hi folks,
Thank you so much for creating this theme for Astro.
I've adopted it for my personal website and it's exactly what I wanted from a minimal blog template.
As a follow-up question - what would be the right way to attribute credit back to your work?
Is it ok if I keep the footer entry of Made by onWidget · All rights reserved.
minus the icon to keep things clean and simple?
Hi,
In the description it is stated that MDX files are supported in data/blog folder as well. However when putting MDX files into that folder no blog posts are generated out of those files, only the MD files are considered. Could you please help? Thanks
Hi
I have deployed a site to Cloudflare pages. When I visit a URL, https://mysite.com/post-name Cloudflare redirects it to https://mysite.com/post-name/ (with the trailing /) as a 308 redirect. This doesn't happen in the Dev environment and appears to be a known "feature" in Cloudflare pages. This is not ideal as it adds an extra request, so some load time.
Is there any way I could add the trailing / to generated links via the theme (e.g., in my blog post list, have the URLs be https//mysite.com/my-post/ instead of https//mysite.com/my-post)?
Thanks
Rob
There's a lil bug whenever the site was opened in mobile device after removing collapse
in header section f580fe7
. i know its confusing, in other hand we want the navigation work smoothly by removing collapse
but in other hand too there is a blinked navigation menu when it is opened on a mobile device
Hi!
Would love to see the internationalization support, please.
Example implementation in Astro:
https://github.com/withastro/astro/tree/main/examples/docs
Thank you!
Add an option to enable full body content into the RSS feed. Meaning that the blog post becomes embedded into the feed on its own.
This feature would enable readers to not have to visit my site directly every time in order to get the info they want (my blog posts in this case)
First and foremost, I would like to thank you for creating this wonderful template! I've just recently started to use it, and it has been a real joy to work with.
Using npm v9.1.2
and node v14.18.1
. I had a look on the Astro Discord and couldn't see any similar issues popping up for anyone.
Steps to reproduce, on the latest main
npm install
npm run start
Error message
file:///Users/irrelevant/astrowind/astro.config.mjs:12
import { remarkReadingTime } from './src/utils/frontmatter.js';
^^^^^^^^^^^^^^^^^
SyntaxError: Named export 'remarkReadingTime' not found. The requested module './src/utils/frontmatter.js' is a CommonJS module, which may not support all module.exports as named exports.
a9d5667 is the latest commit that works for me. The next commit is upgrading Astro to 1.6.8
Steps to get running
git checkout a9d56673b47d9c4c7d41977eec13f2fb1b88fe54
npm install
npm run start
In your blog post in the array of tags if you ad a "Tag" with capital "T" and press on that tag on the website you will only see posts with "tag".
I expected for tags to ignore character cases.
I build out some sections on the homepage of the template, I added anchor links to the navbar so a site user can jump between sections of the page.
When using the site on mobile, I noticed that the links work (they take you to the correct section of the page as I can see the url change) But the mobile menu does not disappear.
The BasicScripts.Astro file has an attach event and an onpageshow event that look to be handling the display property for the mobile menu.
attachEvent('[data-aw-toggle-menu]', 'click', function (_, elem) {
elem.classList.toggle('expanded');
document.body.classList.toggle('overflow-hidden');
document.getElementById('header')?.classList.toggle('h-screen');
document.querySelector('#header nav')?.classList.toggle('hidden');
});
window.onpageshow = function () {
document.documentElement.classList.add('motion-safe:scroll-smooth');
const elem = document.querySelector('[data-aw-toggle-menu]');
if (elem) {
elem.classList.remove('expanded');
}
document.body.classList.remove('overflow-hidden');
document.getElementById('header')?.classList.remove('h-screen');
document.querySelector('#header nav')?.classList.add('hidden');
};
1
In order to execute the project in my local environment, I executed the following commands:
npm install
npm run dev
The page http://localhost:3000 works, but when I click on blog link (http://localhost:3000/blog) I get this error:
error Missing or empty required params property on getStaticPaths route
Hint:
See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths.
File:
/home/francesco/MyApp/website/src/pages/[...tags]/[tag]/[...page].astro
Stacktrace:
GetStaticPathsExpectedParams: Missing or empty required params property on getStaticPaths route
at file:///home/francesco/MyApp/website/node_modules/astro/dist/core/routing/validation.js:42:13
at Array.forEach (<anonymous>)
at validateGetStaticPathsResult (file:///home/francesco/MyApp/website/node_modules/astro/dist/core/routing/validation.js:40:10)
at callGetStaticPaths (file:///home/francesco/MyApp/website/node_modules/astro/dist/core/render/route-cache.js:28:5)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async getParamsAndProps (file:///home/francesco/MyApp/website/node_modules/astro/dist/core/render/core.js:24:25)
at async matchRoute (file:///home/francesco/MyApp/website/node_modules/astro/dist/vite-plugin-astro-server/route.js:27:31)
at async run (file:///home/francesco/MyApp/website/node_modules/astro/dist/vite-plugin-astro-server/request.js:38:28)
at async runWithErrorHandling (file:///home/francesco/MyApp/website/node_modules/astro/dist/vite-plugin-astro-server/controller.js:65:5)
at async handleRequest (file:///home/francesco/MyApp/website/node_modules/astro/dist/vite-plugin-astro-server/request.js:34:3)
Dev script fails to start.
After git clone from https://github.com/onwidget/astrowind/tree/8db176fe924f50fa84bfc31c09e6150a5dde71de
pnpm install, pnpm run dev
Windows 10.0.22621
node 18.15.0
pnpm 8.0.0
Setting sharp to 0.31.3 instead of 0.32.0 fixes the issue.
See log below.
PS C:\PROG\_bug-repros> git clone https://github.com/onwidget/astrowind repro-astrowind
Cloning into 'repro-astrowind'...
remote: Enumerating objects: 4408, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4408 (delta 0), reused 1 (delta 0), pack-reused 4405
Receiving objects: 100% (4408/4408), 11.05 MiB | 4.92 MiB/s, done.
Resolving deltas: 100% (2558/2558), done.
PS C:\PROG\_bug-repros> cd .\repro-astrowind\
PS C:\PROG\_bug-repros\repro-astrowind> pnpm install
WARN deprecated [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
Packages: +784
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
Content-addressable store is at: C:\Users\Lionel\AppData\Local\pnpm\store\v3
Virtual store is at: node_modules/.pnpm
Progress: resolved 806, reused 784, downloaded 0, added 784, done
node_modules/.pnpm/[email protected]/node_modules/nodejieba: Running install script, failed in 5.3s (skipped as optional)
node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script, done in 506ms
devDependencies:
+ @astrojs/image 0.16.2 (0.16.3 is available)
+ @astrojs/mdx 0.18.2
+ @astrojs/partytown 1.1.1 (1.2.0 is available)
+ @astrojs/rss 2.3.1
+ @astrojs/sitemap 1.2.1
+ @astrojs/tailwind 3.1.1
+ @astrolib/analytics 0.3.0
+ @astrolib/seo 0.3.0
+ @fontsource/inter 4.5.15
+ @tailwindcss/typography 0.5.9
+ @typescript-eslint/eslint-plugin 5.57.0
+ @typescript-eslint/parser 5.57.0
+ astro 2.1.7 (2.1.8 is available)
+ astro-compress 1.1.35
+ astro-icon 0.8.0
+ eslint 8.36.0 (8.37.0 is available)
+ eslint-plugin-astro 0.26.1
+ eslint-plugin-jsx-a11y 6.7.1
+ limax 2.1.0 (4.0.0 is available)
+ mdast-util-to-string 3.1.1
+ prettier 2.8.7
+ prettier-plugin-astro 0.8.0
+ reading-time 1.5.0
+ sharp 0.32.0
+ svgo 2.8.0 (3.0.2 is available)
+ tailwindcss 3.2.7 (3.3.0 is available)
+ typescript 5.0.2
WARN Issues with peer dependencies found
.
└─┬ astro 2.1.7
└── ✕ unmet peer sharp@^0.31.3: found 0.32.0
The integrity of 5901 files was checked. This might have caused installation to take longer.
Done in 37.6s
PS C:\PROG\_bug-repros\repro-astrowind> pnpm run dev
> @onwidget/[email protected] dev C:\PROG\_bug-repros\repro-astrowind
> astro dev
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
Error:
Something went wrong installing the "sharp" module
The specified procedure could not be found.
\\?\C:\PROG\_bug-repros\repro-astrowind\node_modules\.pnpm\s[email protected]\node_modules\sharp\build\Release\sharp-win32-x64.node
Possible solutions:
- Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"
- Install for the current win32-x64 runtime: "npm install --platform=win32 --arch=x64 sharp"
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
- Ensure the version of sharp aligns with the .pnpm package: "npm ls sharp"
at Object.<anonymous> (C:\PROG\_bug-repros\repro-astrowind\node_modules\.pnpm\s[email protected]\node_modules\sharp\lib\sharp.js:37:9)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
at Object.<anonymous> (C:\PROG\_bug-repros\repro-astrowind\node_modules\.pnpm\s[email protected]\node_modules\sharp\lib\constructor.js:11:1)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10) {
plugin: undefined,
hint: 'Browser APIs are not available on the server.\n' +
'\n' +
'If the code is in a framework component, try to access these objects after rendering using lifecycle methods or use a `client:only` directive to make the component exclusively run on the client.\n' +
'\n' +
'See https://docs.astro.build/en/guides/troubleshooting/#document-or-window-is-not-defined for more information.\n' +
'\t\t'
}```
Node.js v18.15.0
ELIFECYCLE Command failed with exit code 1.
I just cloned, built and previewed.
But I am not getting the same lighthouse scores: https://share.getcloudapp.com/wbuQr0bx
Lighthouse suggests the css is not minified-gziped.
Am I forgetting anything?
So I had this situation on VSCode when saving .astro files, wonder if anyone is having the same issue (if its a issue to begin with):
["INFO" - 15:40:30] Formatting file:///%path%\project/src/components/widgets/Footer.astro
["INFO" - 15:40:30] Using config file at '%path%\project\.prettierrc'
["INFO" - 15:40:30] Using ignore file (if present) at '%path%\project\.prettierignore
["INFO" - 15:40:30] File Info:
{
"ignored": false,
"inferredParser": null
}
["WARN" - 15:40:30] Parser not inferred, trying VS Code language.
["ERROR" - 15:40:30] Failed to resolve a parser, skipping file. If you registered a custom file extension, be sure to configure the parser.
My expectation is that VSCode format the current file on save, which wasn't happening.
The solution I found: Switch to .prettierrc.js
and add the override for parser .astro and require the prettier-plugin-astro (line 2) as below:
Note: I tried the override in original .prettierrc
file but I couldn't make it work.
module.exports = {
plugins: [require.resolve('prettier-plugin-astro')],
printWidth: 120,
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5',
useTabs: true,
overrides: [
{
files: '*.astro',
options: {
parser: 'astro',
},
},
{
files: ['.*', '*.json', '*.md', '*.toml', '*.yml'],
options: {
useTabs: false,
},
},
],
};
With .prettierrc.js
I can save and it will format .astro files.
But I was looking at the commits, and at a time there was this config .prettierrc.js but it was removed. Commit was named: "Remove prettier until prettier-plugin-astro v1.x"
Then prettier was added back with .prettierrc file on this commit
am I missing any context or something else?
New to Astro here, and have tried to follow along some of the guides but weren't able to get this going. It seems that post.js
is also a specific helper outside of the Astro files.
Would be glad to see an update to the theme with both .md
and .mdx
supported if that's something you ever get around to :-)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.