Template Project Project Doesn't Run At All - Parse failure: Unexpected token At file: /node_modules/@astrojs/image/dist/lib/get-image.js #8 #7996
Labels
- P3: minor bug
An edge case that only affects very specific usage (priority)
pkg: image
Related to the `@astrojs/image` package (scope)
What version of
astro
are you using?2.8.0
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Mac
What browser are you using?
Chrome, Firefox, Safari
Describe the Bug
Hi,
Have cloned this entire project: https://github.com/mhyfritz/astro-landing-page
Run the commands:
npm install
npm run dev
Visiting http://localhost:3000/
I receive the following error message on the webpage:
Error An error occurred. Parse failure: Unexpected token (81:70) At file: /node_modules/@astrojs/image/dist/lib/get-image.js Contents of line 81: const isDev = (_b = (Object.assign(import.meta.env,{_:process.env._,-:process.env.-,SSR:true,}))) == null ? void 0 : _b.DEV;
And the following error message on terminal
`
Parse failure: Unexpected token (81:70)
At file: /node_modules/@astrojs/image/dist/lib/get-image.js
Contents of line 81: const isDev = (b = (Object.assign(import.meta.env,{:process.env._,-:process.env.-,SSR:true,}))) == null ? void 0 : b.DEV;
Parse failure: Unexpected token (81:70)
At file: /node_modules/@astrojs/image/dist/lib/get-image.js
Contents of line 81: const isDev = (b = (Object.assign(import.meta.env,{:process.env.,-:process.env.-,SSR:true,}))) == null ? void 0 : b.DEV; (x2)
7:13:10 pm [vite] Error when evaluating SSR module /node_modules/@astrojs/image/dist/index.js: failed to import "/node_modules/@astrojs/image/dist/lib/get-image.js"
|- Error: Parse failure: Unexpected token (81:70)
At file: /node_modules/@astrojs/image/dist/lib/get-image.js
Contents of line 81: const isDev = (b = (Object.assign(import.meta.env,{:process.env.,-:process.env.-,SSR:true,}))) == null ? void 0 : _b.DEV;
at ssrTransformScript (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53776:15)
at ssrTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53751:12)
at Object.ssrTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:63307:20)
at loadAndTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53422:24)
7:13:10 pm [vite] Error when evaluating SSR module /node_modules/@astrojs/image/components/Image.astro: failed to import "/node_modules/@astrojs/image/dist/index.js"
|- Error: Parse failure: Unexpected token (81:70)
At file: /node_modules/@astrojs/image/dist/lib/get-image.js
Contents of line 81: const isDev = (b = (Object.assign(import.meta.env,{:process.env._,-:process.env.-,SSR:true,}))) == null ? void 0 : _b.DEV;
at ssrTransformScript (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53776:15)
at ssrTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53751:12)
at Object.ssrTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:63307:20)
at loadAndTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53422:24)
7:13:10 pm [vite] Error when evaluating SSR module /node_modules/@astrojs/image/components/index.ts: failed to import "/node_modules/@astrojs/image/components/Image.astro"
|- Error: Parse failure: Unexpected token (81:70)
At file: /node_modules/@astrojs/image/dist/lib/get-image.js
Contents of line 81: const isDev = (b = (Object.assign(import.meta.env,{:process.env._,-:process.env.-,SSR:true,}))) == null ? void 0 : _b.DEV;
at ssrTransformScript (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53776:15)
at ssrTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53751:12)
at Object.ssrTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:63307:20)
at loadAndTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53422:24)
7:13:10 pm [vite] Error when evaluating SSR module /src/components/hero-image.astro: failed to import "/node_modules/@astrojs/image/components/index.ts"
|- Error: Parse failure: Unexpected token (81:70)
At file: /node_modules/@astrojs/image/dist/lib/get-image.js
Contents of line 81: const isDev = (b = (Object.assign(import.meta.env,{:process.env._,-:process.env.-,SSR:true,}))) == null ? void 0 : _b.DEV;
at ssrTransformScript (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53776:15)
at ssrTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53751:12)
at Object.ssrTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:63307:20)
at loadAndTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53422:24)
7:13:10 pm [vite] Error when evaluating SSR module /src/components/footer.astro: failed to import "/src/components/hero-image.astro"
|- Error: Parse failure: Unexpected token (81:70)
At file: /node_modules/@astrojs/image/dist/lib/get-image.js
Contents of line 81: const isDev = (b = (Object.assign(import.meta.env,{:process.env._,-:process.env.-,SSR:true,}))) == null ? void 0 : _b.DEV;
at ssrTransformScript (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53776:15)
at ssrTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53751:12)
at Object.ssrTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:63307:20)
at loadAndTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53422:24)
7:13:10 pm [vite] Error when evaluating SSR module /Users/tehnoob/Documents/Work/HiTehnoob/astro-2/src/pages/index.astro: failed to import "/src/components/footer.astro"
|- Error: Parse failure: Unexpected token (81:70)
At file: /node_modules/@astrojs/image/dist/lib/get-image.js
Contents of line 81: const isDev = (b = (Object.assign(import.meta.env,{:process.env._,-:process.env.-,SSR:true,}))) == null ? void 0 : _b.DEV;
at ssrTransformScript (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53776:15)
at ssrTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53751:12)
at Object.ssrTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:63307:20)
at loadAndTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53422:24)
error Parse failure: Unexpected token (81:70)
At file: /node_modules/@astrojs/image/dist/lib/get-image.js
Contents of line 81: const isDev = (b = (Object.assign(import.meta.env,{:process.env._,-:process.env.-,SSR:true,}))) == null ? void 0 : b.DEV;
Error: Parse failure: Unexpected token (81:70)
At file: /node_modules/@astrojs/image/dist/lib/get-image.js
Contents of line 81: const isDev = (b = (Object.assign(import.meta.env,{:process.env.,-:process.env.-,SSR:true,}))) == null ? void 0 : _b.DEV;
at ssrTransformScript (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53776:15)
at ssrTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53751:12)
at Object.ssrTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:63307:20)
at loadAndTransform (file:///Users/tehnoob/Documents/Work/HiTehnoob/astro-2/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:53422:24)`
Was really excited to work with this but I can't even get the project to load on vanilla.
What's the expected result?
The project runs and loads the page without fault
Link to Minimal Reproducible Example
https://stackblitz.com/github/mhyfritz/astro-landing-page
Participation
The text was updated successfully, but these errors were encountered: