Skip to content

vite: workaround no longer needed #649

Closed

Description

@AndreyYolkin

Environment


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

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)

Activity

  1. danielroe commented on Nov 30, 2022

    @danielroe
    Member

    I believe this is already implemented in #648.

  2. AndreyYolkin commented on Nov 30, 2022

    @AndreyYolkin
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions