-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Top-level await is not available when updating pnpm lock #5517
Comments
I'm working on narrowing down the issue cause and it boils down to importing the .mjs config from a js file which is a remark plugin even unused lodaded on dev mode import config from '../../astro.config.mjs' I'll try to create a minimal example and then point out the exact package and version with which the dev error start. |
Mico example now in a single file single line Example Crashes dev mode
import { defineConfig } from 'astro/config';
import config from './config.mjs'
console.log(config) Example works fine
//import { defineConfig } from 'astro/config';
import config from './config.mjs'
console.log(config) Noe that here intentionally an import of an mjs module is kept to show that it's not du to generic import of .mjs but due to a specific one in const config = {}
console.log(config)
export default config; |
So given that this is unlikely to be an issue in Astro's code but Vite behavior, and given that nowhere it was recommended in Astro's doc to import the |
unstable behvior not as reproted above sometimes only importing as such breaks dev import config from '../../astro.config.mjs'
console.log(config) |
You can workaround this for now by specifying:
in your Astro config. Re-opening this for now as this should probably be added by Astro by default. |
Excellent, thanks a lot @bluwy for taking this serious and reopening the issue. |
I also had to exclude
|
What version of
astro
are you using?1.6.12
Are you using an SSR adapter? If so, which one?
Node
What package manager are you using?
pnpm
What operating system are you using?
Window
Describe the Bug
in this exact commit (or some of the previous) work fine MicroWebStacks/astro-big-doc@a06ed36 if I delete the
pnpm-lock.yaml
file and reinstallpnpm install
pnpm run build
runs perfectly fine, but I start getting the error and crash inpnpm run dev
modethis is a commit with the newly generated not working lock
pnpm-lock.yaml
file MicroWebStacks/astro-big-doc@959171cThis are main diffs I spotted, I keep trying all possible combinations of newer versions of astro, mdx, vite, rollup, without success, I cannot get rid of the
Top-level await is not available
error anymore. Any hints Or correct versions to use or is any depedency causing thisLink to Minimal Reproducible Example
Issue reproducible in this commit :
MicroWebStacks/astro-big-doc@959171c
Issue not reproducible in this previous commit with same package but different lock
MicroWebStacks/astro-big-doc@a06ed36
good and bad pnpm.lock files
I had to rename lock files from .yaml to .txt to be able to attach them here
pnpm-lock - committed - ok.txt
pnpm-lock - new - not ok.txt
Participation
The text was updated successfully, but these errors were encountered: