Skip to content
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

Vite and MiniOxygen errors when using vanilla-extract and formik #2468

Open
ramiroazar opened this issue Aug 26, 2024 · 0 comments
Open

Vite and MiniOxygen errors when using vanilla-extract and formik #2468

ramiroazar opened this issue Aug 26, 2024 · 0 comments
Assignees
Labels
Bug Something isn't working

Comments

@ramiroazar
Copy link

What is the location of your example repository?

https://github.com/ramiroazar/hydrogen-storefront/tree/test/formik

Which package or tool is having this issue?

Hydrogen

What version of that package or tool are you using?

2024.7.4

What version of Remix are you using?

2.11.2

Steps to Reproduce

To reproduce using example repository:

  1. git clone git@github.com:ramiroazar/hydrogen-storefront.git
  2. git checkout test/formik
  3. npm install
  4. npm run dev

To reproduce from scratch:

  1. npm create @shopify/hydrogen@latest (Use sample data from mock.shop, TypeScript, Vanilla Extract)
  2. npm install formik
  3. Replicate changes from test/formik branch in example repository (ie. ramiroazar/hydrogen-storefront@main...test/formik)
  4. npm run dev

Expected Behavior

Both the basic Formik example and the Vanilla Extract styles should render without any errors.

Actual Behavior

We get the following critical Vite and MiniOxygen errors in both the terminal and the browser.

Error during module fetch: Error: There is a new version of the pre-bundle for "/Users/ramiroazar/repository/hydrogen-storefront/node_modules/.vite/deps_ssr/react-fast-compare.js?v=d280c6ba", a page reload is going to ask for it.

MiniOxygen encountered an error while running your app's entry point

Image

Image

Removing either the Vanilla Extract class on this line or the Formik form on this line makes the error disappear, but only after restarting the dev server.

Adding either one back doesn't throw any errors while the dev server is running, but throws the same error after restarting the server.

I wasn't able to replicate this in a project using Hydrogen 2024.4.6 and Remix 2.9.2.

Not sure if this is related to issue #2366, but the MiniOxygen error is very similar.

It may also be related to issue #2266, because of the ERR_OUTDATED_OPTIMIZED_DEP error code.

@juanpprieto juanpprieto added the Bug Something isn't working label Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants