analogjs / analog

The fullstack meta-framework for Angular. Powered by Vite and Nitro
https://analogjs.org
MIT License
2.5k stars 240 forks source link

TypeError: Cannot read properties of undefined (reading 'minimalContext') #1166

Closed monacodelisa closed 2 months ago

monacodelisa commented 3 months ago

Please provide the environment you discovered this bug in.

Analog version

v1.5.0

Tested on:

3 windows machines 1 stackblitz

https://stackblitz.com/github/analogjs/analog/tree/stackblitz/packages/create-analog/template-latest?file=vite.config.ts&preset=node

image

Which area/package is the issue in?

create-analog

Description

after running

Please provide the exception or error you saw

TypeError: Cannot read properties of undefined (reading 'minimalContext')
TypeError: Cannot read properties of undefined (reading 'minimalContext')

Other information

so far I know that this affects the styles:

I first encountered the error within the last 48h

As much as I would like to I could not submit a PR since I do not know where that minimalContext is, could not find it

I would be willing to submit a PR to fix this issue

brandonroberts commented 3 months ago

The issue is the Angular CLI is pinned to 5.2.11 and using ^5.0.0 installs the latest version of Vite which is 5.3.0. This causes two copies of Vite to be installed.

The fix has already landed on beta but you can update your package.json for Vite to ~5.2.11

monacodelisa commented 2 months ago

thank you so much @brandonroberts I will make the suggested adjustments 🙏

brandonroberts commented 1 month ago

Landed a proper fix for this in https://github.com/analogjs/analog/pull/1214. It will go out with 1.6.2