-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Error on astro check related to vite - rollup - fsevents #10007
Comments
This usually means that you accidentally imported |
Thank you very much for the reply, i will try and find if anywhere in my codebase, there is accidental import of |
Thank you again for your reply, I solved the issue, which was indeed, caused by my codebase. I today want to give details for the community, because a good practice/pattern comes out of this work on my codebase. Perhaps even a feature request. First: what in my code, was causing the issueIn an So you were very close to guessing my issue @bluwy , but I was not impoting either of What I was trying to do, but did it wrongI wanted to be able to define the value of the base URL of my astro website, using an environment variable. So I used export const myDEPLOYMENT_ASTRO_SITE_CONFIG = process.env.DEPLOYMENT_ASTRO_SITE_CONFIG;
export const myDEPLOYMENT_ASTRO_BASE_CONFIG = process.env.DEPLOYMENT_ASTRO_BASE_CONFIG;
export default defineConfig({
// site: "https://astro-moon-landing.netlify.app/",
site: `${myDEPLOYMENT_ASTRO_SITE_CONFIG || ''}`,
base: `${myDEPLOYMENT_ASTRO_BASE_CONFIG || ''}`
}); Now, in my const { generator, site, base } = Astro; The problem was, that, both So, what I tried, is importing the value of base using As I understood the issue, I then tried to add : export const myDEPLOYMENT_ASTRO_SITE_CONFIG = process.env.DEPLOYMENT_ASTRO_SITE_CONFIG;
export const myDEPLOYMENT_ASTRO_BASE_CONFIG = process.env.DEPLOYMENT_ASTRO_BASE_CONFIG; in my astro file header, and use the ---
export const myDEPLOYMENT_ASTRO_SITE_CONFIG = process.env.DEPLOYMENT_ASTRO_SITE_CONFIG;
export const myDEPLOYMENT_ASTRO_BASE_CONFIG = process.env.DEPLOYMENT_ASTRO_BASE_CONFIG;
---
<a href={`${myDEPLOYMENT_ASTRO_BASE_CONFIG}/something/whatever`} >my super link<a/> And well that was wrong too: the env var was undefined. So, to solve that issue, I instead put into my export const myDEPLOYMENT_ASTRO_SITE_CONFIG = process.env.DEPLOYMENT_ASTRO_SITE_CONFIG;
export const myDEPLOYMENT_ASTRO_BASE_CONFIG = process.env.DEPLOYMENT_ASTRO_BASE_CONFIG; and I imported my constants into the astro file, by importing the ---
import {myDEPLOYMENT_ASTRO_BASE_CONFIG} from './../config.ts'
---
<a href={`${myDEPLOYMENT_ASTRO_BASE_CONFIG}/something/whatever`} >my super link<a/> And finally it worked. To complete the work,i still wanted to have a single one source of truth: so also imported my constants, from my import { myDEPLOYMENT_ASTRO_SITE_CONFIG, myDEPLOYMENT_ASTRO_BASE_CONFIG } from './src/config'
export default defineConfig({
site: `${myDEPLOYMENT_ASTRO_SITE_CONFIG || ''}`,
base: `${myDEPLOYMENT_ASTRO_BASE_CONFIG || ''}`
}); Et voilà. A potential feature request ?That it is possible to import base, just as well as site, like this : const { generator, site, base } = Astro; ? Is there a good reason why it is possible with And therefore thank you again @bluwy |
You can also access both site and base with |
Oh, its true that it would be better I think, to use vite's |
And @bluwy wdyt would it be relevant as a feature request, to be able to access |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
My astro build suddenly tonight got stuck with an error (i give below more details about that error)
I investigated the issue.
The error is related to
vite
,rollup
, and fsevents, which are bundledwithastro
. I therefore soon wondered what astro version i actually had in my project:4.3.3
4.3.3
release was released only 7 hours ago4.3.3
astro
version certainly slipped into my project, as i tonightrm -fr ./node_modules
How to reproduce the error
Assuming that the lastest astro release is the
4.3.3
one, you will reproduce the error by running (on windows, git bash):Note I do reproduce the issue in stackblitz running those exact above commands in the console :
What's the expected result?
That the build completes without errors, since astro build shows :
Link to Minimal Reproducible Example
https://stackblitz.com/~/github.com/3forges/juste-un-curieux
Participation
The text was updated successfully, but these errors were encountered: