-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Cannot access 'ASTRO_VERSION' before initialization #261
Comments
Also with version |
|
Commeting this fix the problem vite.build.rollupOptions.output.manualChunks = (id) => {
if (id.includes("node_modules")) {
if (id.indexOf("node_modules") !== -1) {
// const basic = id.toString().split('node_modules/')[1];
// const sub1 = basic.split('/')[0];
// if (sub1 !== '.pnpm') {
// return sub1.toString();
// }
// const name2 = basic.split('/')[1];
// return name2.split('@')[name2[0] === '@' ? 1 : 0].toString();
}
}
}; de6f3eb#diff-1d2a2b56ad20e7e5b13936929d10bebf30d56ffa7cdc64f686dff4ae6cfafb60R266 But now I have the problem that this commit was trying to address, I tried with astro version It could be that one of that manualChucks is trigger the problem {
"dependencies": {
"@astrojs/alpinejs": "^0.4.0",
"@astrojs/cloudflare": "^10.2.6",
"@astrojs/markdoc": "^0.11.0",
"@astrojs/react": "^3.3.4",
"@astrojs/rss": "^4.0.5",
"@astrojs/sitemap": "^3.1.4",
"@astrojs/tailwind": "^5.1.0",
"@cloudflare/pages-plugin-mailchannels": "^0.1.4",
"@keystatic/astro": "^5.0.0",
"@keystatic/core": "^0.5.14",
"alpinejs": "^3.13.10",
"astro": "4.7.0",
"gsap": "npm:@gsap/business@^3.12.5",
"react": "^18.3.1",
"react-colorful": "^5.6.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@astrolib/seo": "1.0.0-beta.5",
"@biomejs/biome": "1.7.3",
"@bobthered/tailwindcss-palette-generator": "^3.2.3",
"@cloudflare/workers-types": "^4.20240502.0",
"@iconify-json/ic": "^1.1.17",
"@iconify-json/mdi": "^1.1.66",
"@iconify-json/ph": "^1.1.13",
"@iconify-json/solar": "^1.1.9",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.7",
"@tailwindcss/typography": "^0.5.13",
"@types/alpinejs": "^3.13.10",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.3.0",
"@vite-pwa/assets-generator": "^0.2.4",
"@vite-pwa/astro": "^0.4.0",
"astro-icon": "^1.1.0",
"sharp": "0.33.3",
"tailwindcss": "^3.4.3",
"workbox-window": "^7.1.0"
}
} |
Rolling back For the version |
For anyone having the same problem here my full package version that works
Essentially
|
Thanks for submitting this issue. Can you please provide a minimal reproduction, even if it only occurs on Cloudflare. We can always clone the code and rung |
Ok, I think it's a problem with some other integration but I ll make some tests |
@alexanderniebuhr I just stumbled across this against a public repo - if I take https://github.com/IdealProject/ideal ; which currently uses 9.2.1 and update to 10.X, it gives the same ASTRO_VERSION error |
After multiple tries I found how to reproduce the problem consistenly, the problem happen with the markdoc integration when there is at least a google_screen_recording_2024-05-26T13-16_42.903Z.webmHere the repo I used to test this: https://github.com/zanhk/cannot-access-astro-version, I made it as minimal as possible |
@zanhk Thanks for finding this out. Now we know that it relates to the markdoc integration. Going to try and find a fix soon. |
Thanks @alexanderniebuhr, If you push this version to npm ( |
I am facing same issue, have you found some work around this @zanhk |
I'm hoping that once the upstream bug (withastro/astro#10738) is fixed, we can fix this one too. |
@q1b Right now I m using this versions
|
This should be fixed in the v11 release, which will be published later today to npm. |
Awesome! |
[ERROR] ReferenceError: Cannot access 'page' before initialization "astro": "^4.16.7", |
Astro Info
Describe the Bug
What's the expected result?
It's probably a problem with some other integration but commeting
seem to avoid the problem, just wanna ask if it's happened to someone else.
Thanks
Link to Minimal Reproducible Example
This problem happen specifically on cloudflare so I cannot reproduce on stackblitz or others
Participation
The text was updated successfully, but these errors were encountered: