Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

feat(schema, vite)!: enable vite-node by default #6217

Merged
merged 14 commits into from
Aug 13, 2022
Merged

Conversation

antfu
Copy link
Member

@antfu antfu commented Jul 29, 2022

πŸ”— Linked issue

nuxt/nuxt#13994

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@netlify
Copy link

netlify bot commented Jul 29, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit 4a12278
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/62f79b1000eb070009e2a401

packages/vite/src/vite.ts Outdated Show resolved Hide resolved
@misaon
Copy link
Contributor

misaon commented Jul 29, 2022

This will broke all guys which use docker for develop in Nuxt:
nuxt/nuxt#13587

@pi0
Copy link
Member

pi0 commented Jul 29, 2022

Thanks for the notice @misaon. Do you mind creating a new issue for vite-node+docker with your docker[compose] file to reproduce?

@misaon
Copy link
Contributor

misaon commented Jul 29, 2022

@pi0 I can create a sandbox where the bug can be simulated. However, as has already been written in the thread, the bug manifests itself randomly. It doesn't seem to have an obvious cause, it's just that during development (editing components, pages, composables) a situation arises where the bug appears. In our team, where we develop in Docker projects built on Nuxt, the problem happens randomly to everyone.

We have found that if this error appears in the console, we have to make a change in some vue file (sometimes several times) to get the watcher to start again and work properly. We use the simplest form of Dockerfile

FROM node:18.6.0-alpine3.15 as nuxtBuild

WORKDIR /app

COPY ./ ./

RUN yarn install \
    && yarn run build


FROM node:18.6.0-alpine3.15

ENV HOST=0.0.0.0
WORKDIR /app

COPY --from=nuxtBuild /app/.output /app/.output

It is possible that this is the fault of the Alpine distribution itself, but it is on this distribution that NodeJS officially publishes its docker images.

@pi0 pi0 marked this pull request as draft July 29, 2022 13:02
@pi0
Copy link
Member

pi0 commented Jul 29, 2022

I can confirm the same issue. It seems not even limited to docker but any Linux/Windows env, HMR watcher is ignored for server and only applied to the client, therefore, having hydration mismatch.

I've converted PR to draft until we solve this. ~> nuxt/nuxt#14469

It might be related to issue nuxt/nuxt#12822 since now client HMR on linux works and Server not (in current nuxt, it is otherwise). But also trying CHOKIDAR_USEPOLLING=1 I still have issue.

@misaon
Copy link
Contributor

misaon commented Jul 29, 2022

Good work @pi0! ❀️

@pi0 pi0 changed the title feat(vite): enable vite-node by default feat(schema, vite)!: enable vite-node by default Aug 13, 2022
@pi0 pi0 marked this pull request as ready for review August 13, 2022 12:30
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM at current status. I cannot reproduce (at least stabily) HMR issues. I think we can move it forward to test on edge until next rc.

@pi0 pi0 merged commit 1b2304b into main Aug 13, 2022
@pi0 pi0 deleted the feat/enable-vite-node branch August 13, 2022 12:43
@pi0 pi0 mentioned this pull request Aug 26, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants