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: workaround no longer needed #649

Closed
AndreyYolkin opened this issue Nov 30, 2022 · 2 comments · Fixed by #648
Closed

vite: workaround no longer needed #649

AndreyYolkin opened this issue Nov 30, 2022 · 2 comments · Fixed by #648

Comments

@AndreyYolkin
Copy link
Contributor

Environment


  • Operating System: Linux
  • Node Version: v16.15.1
  • Nuxt Version: 2.16.0-27720022.54e852f
  • Nitro Version: 0.6.1
  • Package Manager: npm@8.13.2
  • Builder: vite
  • User Config: bridge, serverHandlers, devServerHandlers, typescript, buildModules
  • Runtime Modules: -
  • Build Modules: (), @nuxt/bridge@3.0.0-27830071.32c4527

Reproduction

https://stackblitz.com/github/AndreyYolkin/latest-bridge-vite-workaround-issue
https://github.com/AndreyYolkin/latest-bridge-vite-workaround-issue

Describe the bug

Nuxt bridge with fresh dependencies uses vite which causes 404 errors for assets. Fast search in source code returned workaround for vite, which no longer needed as far as I concerned. Removing this 3 lines helps to run dev server without errors.
image

Additional context

bridge/src/vite/client.ts

Lines 113 to 115 in 0fb6cfc

if (!originalURL.startsWith(clientConfig.base!)) {
event.req.url = joinURL('/__url', originalURL)
}

Logs

ERROR  6:08:55 PM [vite] Internal server error: ENOENT: no such file or directory, open '/__url/.nuxt/components/nuxt-error.vue'                                                                                                                                                                                            18:08:55
      at Object.openSync (node:fs:585:3)
      at Object.readFileSync (node:fs:453:35)
      at getDescriptor (file:///home/user/family/latest-bridge/node_modules/@vitejs/plugin-vue2/dist/index.mjs:2225:66)
      at Context.load (file:///home/user/family/latest-bridge/node_modules/@vitejs/plugin-vue2/dist/index.mjs:3210:28)
      at Object.load (file:///home/user/family/latest-bridge/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:40201:46)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async loadAndTransform (file:///home/user/family/latest-bridge/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:36553:24)


 ERROR  6:08:55 PM [vite] Internal server error: ENOENT: no such file or directory, open '/__url/.nuxt/components/nuxt-loading.vue'                                                                                                                                                                                          18:08:55
      at Object.openSync (node:fs:585:3)
      at Object.readFileSync (node:fs:453:35)
      at getDescriptor (file:///home/user/family/latest-bridge/node_modules/@vitejs/plugin-vue2/dist/index.mjs:2225:66)
      at Context.load (file:///home/user/family/latest-bridge/node_modules/@vitejs/plugin-vue2/dist/index.mjs:3210:28)
      at Object.load (file:///home/user/family/latest-bridge/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:40201:46)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async loadAndTransform (file:///home/user/family/latest-bridge/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:36553:24)
@danielroe
Copy link
Member

I believe this is already implemented in #648.

@AndreyYolkin
Copy link
Contributor Author

Yes, I found this lines in your PR. Great job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants