404 when accessing index page in production mode

luminarious
25
luminarious
commented 2 years ago

I was just testing the template, no changes at all.

(node:42238) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Request failed with status code 404
(node:42238) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

macOS Sierra
Node v7.7.3
NPM v4.1.2

0
vuchl
150
vuchl
commented 2 years ago

Hello @luminarious!
I updated the repo to latest packages versions and set it so that Node 8.1.x+ is required. Could you try again? I don't have any apple computers around here.

Regards vuchl

0
luminarious
25
luminarious
commented 2 years ago

Much better, but I still had to manually fix two places where the Vue template had disappeared:

Index.vue:
<nuxt-link :to="{ name: 'id', params: { id: index }}" class="button">{{ user.name }}</nuxt-link>

_id.vue:
<h2 class="info">{{ user.name }}</h2>

0
vuchl
150
vuchl
commented 2 years ago

@luminarious the things you mentioned in the comment are actually in the code (https://github.com/nuxt-community/nuxt-micro-template/blob/master/template/pages/index.vue#L10 and https://github.com/nuxt-community/nuxt-micro-template/blob/master/template/pages/_id.vue#L8). it seems to happen when you pull in the repo via vue init nuxt-community/nuxt-micro-template. then this stuff is missing. but i have no clue why

ideas @Atinux or @alexchopin ?

0
Atinux
22.2k
Atinux
commented 2 years ago

Hi,

We are going to change the way to install the templates soon, this will fix this issue.

I'll keep you updated.

0
vuchl
150
vuchl
commented 2 years ago

@Atinux is this actually a nuxt problem? I'd maybe put it at vue-clis fault

0
Atinux
22.2k
Atinux
commented 2 years ago

@vuchl it's indeed vue-cli fault, that's why we will use nuxt-cli pretty soon.

0
vuchl
150
vuchl
commented 2 years ago

Is it the templating that is happening when you setup the project after you did vue init ...?

0
qm3ster
383
qm3ster
commented a year ago

I fixed the interpolations disappearing by wrapping <template> in {{{raw}}} in #6.
(only in the 3/4 of the .vue files that do use interpolations)
Pretty weird that vue-cli, to this day, has such poor support for the .vue files that it does not ignore normal syntax by default.

1
qm3ster
383
qm3ster
commented a year ago

Reasoning behind leaving it this way on vue-cli repo.

tl;dr: very little interpolation is usually done in templates, since they are about wiring up the technologies and not about including meaningful amounts of content. For this use, {{{raw}}} and \{{escapedVueInterpolation}} are sufficient.

They also mention sao as an alternative. Perhaps nuxt project could use this for examples.

1
Atinux
22.2k
Atinux
commented a year ago

#6 has been merged and fix this issue.

We will create our own nuxt-cli after 1.0 release, we might change to use our own templates too :)

0
Informations
Question โ€ข Unresolved
#c5 - Created 2 years ago