You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But whenever the redirect key is "/" or "", the build fails (node v20.3.0):
09:28:38 PM [build] Building static entrypoints...
[@astro/plugin-build-internals] Failed to resolve entry for package "/usr/local/var/www/blog". The package may have incorrect main/module/exports specified in its package.json.
error Failed to resolve entry for package "/usr/local/var/www/blog". The package may have incorrect main/module/exports specified in its package.json.
File:
/usr/local/var/www/blog/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:23382:11
Code:
23381 | function packageEntryFailure(id, details) {
> 23382 | throw new Error(`Failed to resolve entry for package "${id}". ` +
| ^
23383 | `The package may have incorrect main/module/exports specified in its package.json` +
23384 | (details ? ': ' + details : '.'));
23385 | }
Stacktrace:
pnpm run dev works though, it's only pnpm run build that fails.
I've implemented a workaround by using a double slash, like so: "//": "/blog", then it behaves as expected.
What's the expected result?
Being able to build the site with the intended redirect.
because '/' was occupied by the vite.
I want to add the '/' after the '/' if the user has used '/' as a redirect path.but I feel that it's maybe not a good idea. I'm afraid of my work being useless.
could you share you idea ,if you are available
* Update redirects static generation based on recs
Got some great recommendations on how to handle our HTML written
redirect code based on SEO best practices.
See withastro/roadmap#466 (comment)
This implements them all.
* Fix for using the root path / as a redirect
Fixes#7478
* Fix static redirects prefer over dynamic page
Fixes#7581
What version of
astro
are you using?2.7.0
Are you using an SSR adapter? If so, which one?
No
What package manager are you using?
pnpm (but happens with all)
What operating system are you using?
Mac
What browser are you using?
Firefox
Describe the Bug
My aim is to use /blog as the homepage instead of /, which I tried using aredirect, like this:
astro.config.mjs
But whenever the redirect key is
"/"
or""
, the build fails (node v20.3.0):pnpm run dev
works though, it's onlypnpm run build
that fails.I've implemented a workaround by using a double slash, like so:
"//": "/blog"
, then it behaves as expected.What's the expected result?
Being able to build the site with the intended redirect.
Link to Minimal Reproducible Example
https://stackblitz.com/github/withastro/astro/tree/latest/examples/blog?file=astro.config.mjs&on=stackblitz
Participation
The text was updated successfully, but these errors were encountered: