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

/app renders app.vue in development #15052

Closed
jpengelbrecht opened this issue Sep 29, 2022 · 5 comments · Fixed by nuxt/framework#7989
Closed

/app renders app.vue in development #15052

jpengelbrecht opened this issue Sep 29, 2022 · 5 comments · Fixed by nuxt/framework#7989

Comments

@jpengelbrecht
Copy link

Environment

Nuxi 3.0.0-rc.11 12:32:28
RootDir: /Users/jean-pierre/Projects/site-main/nuxt-app 12:32:29
Nuxt project info: (copied to clipboard) 12:32:29


  • Operating System: Darwin
  • Node Version: v16.13.0
  • Nuxt Version: 3.0.0-rc.9
  • Nitro Version: 0.5.1
  • Package Manager: npm@8.19.2
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

use app.vue as well as pages/app/index.vue

navigate to /app and it will open app.vue instead of using the /app/index.vue page

Describe the bug

when you navigate to localhost:8080/app instead of using the age it just loads app.vue as a file

Additional context

No response

Logs

No response

@danielroe
Copy link
Member

This should be resolved in RC 10 with nuxt/framework#7234.

@jacobsteenstenersen
Copy link

Hey there, I just ran into this issue on rc.11 locally.

Here is a reproduction https://stackblitz.com/edit/github-zsrtkg?file=pages/index.vue

The way I triggered it was appending /app instead of /app/ to the url - in my case it's https://github-zsrtkg--3000.local.webcontainer.io/app

This triggers a page with this output

import { createHotContext as __vite__createHotContext } from "/_nuxt/@vite/client";import.meta.hot = __vite__createHotContext("/app.vue");import { default as __nuxt_component_0 } from "/_nuxt/node_modules/@nuxt/ui-templates/dist/templates/welcome.vue";
const _sfc_main = {}
import { resolveComponent as _resolveComponent, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "/_nuxt/node_modules/.vite/deps/vue.js?v=58dc703d"

function _sfc_render(_ctx, _cache) {
  const _component_NuxtWelcome = __nuxt_component_0

  return (_openBlock(), _createElementBlock("div", null, [
    _createVNode(_component_NuxtWelcome)
  ]))
}


_sfc_main.__hmrId = "938b83b0"
typeof __VUE_HMR_RUNTIME__ !== 'undefined' && __VUE_HMR_RUNTIME__.createRecord(_sfc_main.__hmrId, _sfc_main)
import.meta.hot.accept(mod => {
  if (!mod) return
  const { default: updated, _rerender_only } = mod
  if (_rerender_only) {
    __VUE_HMR_RUNTIME__.rerender(updated.__hmrId, updated.render)
  } else {
    __VUE_HMR_RUNTIME__.reload(updated.__hmrId, updated)
  }
})
import _export_sfc from '/_nuxt/@id/__x00__plugin-vue:export-helper'
export default /*#__PURE__*/_export_sfc(_sfc_main, [['render',_sfc_render],['__file',"/home/projects/github-zsrtkg/app.vue"]])

I'm able to reach a page (in the stackblitz example it's a 404 page) by appending /app/

@danielroe can we reopen this issue?

@danielroe danielroe reopened this Sep 29, 2022
@danielroe danielroe changed the title using app.vue as well as a /app page /app renders app.vue in development Sep 29, 2022
@huang-julien
Copy link
Member

@danielroe this seems to happen with every files, not only with .vue files. Is it an expected behavior ?

@danielroe
Copy link
Member

It is definitely not desired.

@YIngChenIt
Copy link
Contributor

YIngChenIt commented Sep 30, 2022

try use NuxtPage

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.

5 participants