Activities

dnc123

dnc123 posted a new bug report

nuxt.js •

bug Incorrect script tag reading

Version

2.7.1

Reproduction link

https://jsfiddle.net/n6sxhjt8/1/

Steps to reproduce

Create a component (in my case I'm using page component) with an empty space in script tag.

<script> //Error (notice the no space at the start of this line) </script> <script> //all good </script>

What is expected ?

No error

What is actually happening?

An error

willdante

willdante posted a new bug report

nuxt.js •

bug ScrollTop issue in Safari browser only

Version

2.7.1

Reproduction link

https://github.com/willdante/testscroll

Steps to reproduce

  • Install a new Nuxt app with yarn create nuxt-app (no option)
  • Add some content in index.vue to be able to scroll
  • Generate a static site with yarn run generate and host it
  • Open the index page in Safari browser (I've tried in Mac and iPad)
  • Scroll down the page then reload it

What is expected ?

The scroll position should be kept after reloading the page.

What is actually happening?

The scroll position is back to the top of the page after reloading it.

Additional comments?

My tests were made in Safari 12 for Mac and in the latest Safari version for iPad.

si3nloong

si3nloong posted a new question

nuxt.js •

TypeScript Type in NuxtJS

Screenshot 2019-05-25 at 3.33.53 PM.png

How should i define my own type definition and setup for vue plugin in nuxtjs?

paulwanjohi

paulwanjohi posted a new feature request

nuxt.js •

idea Upgrade Tailwind to version 1

What problem does this feature solve?

some of the default configurations is not in sync with tailwind documentation

anat

anat posted a new question

nuxt.js •

Nuxt + mathjs = Pre-generated OK, Client OK, server side (Node.js) KO

Hi everybody,

I'm trying to get my project working on server side (dev) using Nuxt + Math.js.

It actually works on Client (chrome) side and using "nuxt generate" (npm run generate) but it is not working on SSR (Debug).

✔️ Client
✔️ Generated (nuxt generate)
👺 SSR (dev)

There is probably an internal thing that make this to not work on SSR.

First issue

No access to property "foo"

Inside mathjs the function called isPlainObject return false

Here is the function with the debug I added :
node_modules/mathjs/lib/utils/customs.js

function isPlainObject(object) {
  console.log("customs.js object.constructor === Object")
  console.log(object.constructor === Object);
  return _typeof(object) === 'object' && object && object.constructor === Object;
}

Result show : false

Inside my pages/index.vue I have following code : 
 console.log("customs.js object.constructor === Object")
 console.log(scope.constructor === Object);

Result show : true

Second issue

Value has unknown type. Value: [object Object]

I tried to debug this thing, mathjs uses a package created by mathjs author which performs type checking on javascript functions, the problem is in here :
https://github.com/josdejong/typed-function

I'm first trying to figure out for the 1st bug. It seems that they are related (type checking error)

Reproduction link

Here is a mini project to recreate the issues.
https://github.com/anat/bug-mathjs-nuxt/

Steps to reproduce

npm i
npm run dev
  • Go to localhost:3000

  • See bug

Test other case, replace {{ case1() }} by {{ case2() }}

What is expected ?

Should not crash but do the addition in both case1 & case2

willin

willin posted a new bug report

nuxt.js •

bug Failed to execute 'appendChild' on 'Node': This node type does not support this method.

Version

2.6

Reproduction link

http://demo.xibangtech.com/

Steps to reproduce

Source: https://github.com/xibang/xibang.tech

Localhost dev is ok, but when nuxt generate and deploy to server, it occurs error. Besides, all links cannot click then.

What is expected ?

generate and work.

What is actually happening?

Error: [nuxt] Error while mounting app: HierarchyRequestError: Failed to execute 'appendChild' on 'Node': This node type does not support this method.
    at 624151740479ce035ad7.js:1

more

build - ssr - set to false, then localhost develop:

Nuxt.js: Loading app...

auto refresh and refresh … endless

PetrChalov

PetrChalov posted a new bug report

nuxt.js •

bug Not update vuex store values on server

Version

2.7.1

Reproduction link

https://codesandbox.io/s/codesandboxnuxt-8qq7o

Steps to reproduce

Changing store not in parent component - pages/index.vue.
On the server, the values in the component components/SomeComponent.vue are not updated.

What is expected ?

Updating values in SomeComponent.vue when rendering on the server

What is actually happening?

Values not updated.

srunicornio

srunicornio posted a new feature request

nuxt.js •

idea Modify default index.html (dist folder)

What problem does this feature solve?

I have async middleware. In the first load I wait to load crucial data for the app.
While is loading data it shows Nuxt default index.html page (white background with spinner).
It should be customizable. After all I want to decide what show to client while it waiting.

What does the proposed changes look like?

In nuxt.config.js add:

defaultHtml: 'pathToCustomHtml/index.html'

Elevista

Elevista posted a new bug report

nuxt.js •

bug data function is being called after mounted when using transition in-out mode

Version

2.7.1

Reproduction link

https://codesandbox.io/embed/codesandboxnuxt-i8l14

Steps to reproduce

set nuxt-child page transition mode to "in-out" and set transition css and set something new value in mounted lifecycle

please check Reproduction link

What is expected ?

call data function once

What is actually happening?

data function is being called after mounted and $data is being overwritten
스크린샷 2019-05-24 오후 2.14.33.png

nickngqs

nickngqs posted a new question

nuxt.js •

How do disable the debug from the grey screen when error is thrown?

How do I remove the verbose grey screen when error is thrown. I'm looking for a solution where the nuxt view is not being replaced by the NuxtError component

Seonghui

Seonghui posted a new question

nuxt.js •

Fetch and AsyncData not working on reloading page.

https://github.com/nuxt/nuxt.js/issues/1133

I still have a same problem with it but this thread is locked. I use asyncData, fetch in pages. Works fine in localhost but not works on live server. When I reload the page, I got 500 NuxtServerError and log shows me 'Request failed with status code 404'. Does anyone solve this problem?

MR-ZiWeiter

MR-ZiWeiter posted a new question

nuxt.js •

When using Google Maps, when updating a Marker object to Vuex, Maximum call stack size exceeded
chabib

chabib posted a new bug report

nuxt.js •

bug CSS not hashed

Version

2.7.1

Reproduction link

https://codesandbox.io/s/tailwindissue-rl7bj

Steps to reproduce

  • try reproduction locally
  • remove dist from .gitignore
  • npm run build
  • add dist to staging: git add dist/
  • add new tailwind class that never been used before to a component, for example bg-blue-500
  • npm run build
  • git status
  • notice that a css file in _nuxt folder is just modified, instead of new hashed file

What is expected ?

CSS file in build hashed when new css class added to component

What is actually happening?

CSS file in build just modified when new css class added to component

Additional comments?

This causing caching problem for css file _nuxt folder when hosted.
Although we can confidently cache other files in _nuxt folder for long time, say a year, because they are properly hashed.
We have to make exception for css files to have short lifetime cache because of this issue.

harrylyh

harrylyh posted a new question

nuxt.js •

How to debug nuxt in visual code?

Nothing to preview

johnsonjobin

johnsonjobin posted a new question

nuxt.js •

Error: Cannot find module 'typescript'

I did a fresh install of Nuxt using npx create-nuxt-app <project-name>.
Added the following libraries -
Vuetify, Prettier, EsLint, Axios, Jest.
Created a universal app. When i run npm run dev, i get the following error.
I have installed typescript globally.

```ERROR Failed to compile with 1 errors friendly-errors 13:21:37

ERROR in ./plugins/vuetify.js friendly-errors 13:21:37

Module build failed (from ./nodemodules/eslint-loader/index.js):
friendly-errors 13:21:37 Error: Cannot find module 'typescript' Referenced from: /Users/j787209/Documents/Project/buyingGroup/.eslintrc.js
at Function.Module.resolveFilename (internal/modules/cjs/loader.js:580:15)
at Function.Module.load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> /Users/j787209/Documents/Project/buyingGroup/nodemodules/@typescript-
eslint/typescript-estree/dist/parser.js:17:25)
at Module.compile (internal/modules/cjs/loader.js:688:30)
at Object.Module.extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module.load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/Users/j787209/Documents/Project/buyingGroup/nodemodules/@typescript-eslint/experimental-utils/dist/index.js:18:27)
at Module.compile (internal/modules/cjs/loader.js:688:30)
at Object.Module.extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
friendly-errors 13:21:37
@ ./.nuxt/index.js 19:0-72 168:25-53 174:19-47
@ ./.nuxt/client.js
@ multi eventsource-polyfill webpack-hot-middleware/client?reload=true&timeout=30000&ansiColors=&overlayStyles=&name=client&path=/_webpackhmr/client ./.nuxt/client.js
```

johnsonjobin

johnsonjobin posted a new question

nuxt.js •

Error: Cannot find module 'typescript'

I did a fresh install of Nuxt using npx create-nuxt-app <project-name>.
Added the following libraries -
Vuetify, Prettier, EsLint, Axios, Jest.
Created a universal app. When i run npm run dev, i get the following error.

`` ERROR Failed to compile with 1 errors friendly-errors 13:21:37

ERROR in ./plugins/vuetify.js friendly-errors 13:21:37

Module build failed (from ./nodemodules/eslint-loader/index.js): friendly-errors 13:21:37 Error: Cannot find module 'typescript' Referenced from: /Users/j787209/Documents/Project/buyingGroup/.eslintrc.js at Function.Module.resolveFilename (internal/modules/cjs/loader.js:580:15)
at Function.Module.load (internal/modules/cjs/loader.js:506:25) at Module.require (internal/modules/cjs/loader.js:636:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (/Users/j787209/Documents/Project/buyingGroup/nodemodules/@typescript-eslint/typescript-estree/dist/parser.js:17:25)
at Module.compile (internal/modules/cjs/loader.js:688:30) at Object.Module.extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module.load (internal/modules/cjs/loader.js:529:3) at Module.require (internal/modules/cjs/loader.js:636:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (/Users/j787209/Documents/Project/buyingGroup/nodemodules/@typescript-eslint/experimental-utils/dist/index.js:18:27)
at Module.compile (internal/modules/cjs/loader.js:688:30) at Object.Module.extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
friendly-errors 13:21:37
@ ./.nuxt/index.js 19:0-72 168:25-53 174:19-47
@ ./.nuxt/client.js
@ multi eventsource-polyfill webpack-hot-middleware/client?reload=true&timeout=30000&ansiColors=&overlayStyles=&name=client&path=/_webpackhmr/client ./.nuxt/client.js
``

admench

admench posted a new question

nuxt.js •

I don't know how to debug a slow build. ~12-14 minutes for ~700 pages.

I don't know how to debug a slow build. ~12-14 minutes for ~700 pages.

I am using a promise based routes generate config setting:

generate: {
        routes: function () {

            return axios.get(`${process.env.API_BASE_URL}/categories-flat`)
                .then((res) => [...res.data.categories.map((category) => {
                        return {
                            route: '/categories/' + category.slug,
                            payload: category
                        }
                    }),
                    ...res.data.categories.filter(c => c.is_parent).map((category) => {
                        return {
                            route: '/products/category/' + category.slug
                        }
                    }),
                    ...res.data.products.map((product) => {
                        return {
                            route: '/products/' + product.slug,
                            payload: product
                        }
                    }),
                    ...res.data.pages.map((page) => {
                        return {
                            route: page.slug,
                            payload: page
                        }
                    }), {
                        route: '/products',
                        payload: res.data.products
                    }
                ])
        }
    }

The API response time is only 10 seconds or so for the payload, as I have tested that locally and in production. But once the payload is received, the generate process takes 12-14 minutes to process these pages, sometimes even longer. By limiting the number of products down to 200 (instead of 650) I reduce the process time considerably. Does anybody have any tips on how to debug this slow generate build?

nuxt 2.7.1

Many thanks

sts-ryan-holton

sts-ryan-holton posted a new question

nuxt.js •

Nuxt JS LocalStorage in Universal mode not working

I'm working on a Nuxt JS application which utilises LocalStorage. When compiling in SPA mode it functions correctly, however I need to switch my project to universal mode to get my SEO meta titles and descriptions to work when generating my project, after switching I get an error on a few pages which utilise LocalStorage:

localStorage is not defined

Has anyone got any suggestions to fix this?

siberiadev

siberiadev posted a new bug report

nuxt.js •

bug SyntaxError: /.nuxt/nuxt-icons.js: Unexpected token, expected "," (93:1387)

Version

2.7.2

Reproduction link

http://link.re

Steps to reproduce

npm run build

What is expected ?

Normal building

What is actually happening?

ERROR in ./.nuxt/nuxt-icons.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /.nuxt/nuxt-icons.js: Unexpected token, expected "," (93:1387)

Fnxxxxo

Fnxxxxo posted a new feature request

nuxt.js •

idea Add $router.resolve support in programmatic mode.

What problem does this feature solve?

It would be helpful to access $router.resolve instance when using nuxt as a middleware. Check route existence before performing nuxt.render and do page redirect or pass to other routes like /api.

What does the proposed changes look like?

let routeExist = nuxt.resolveRoute('/some-path')