Repository hare

MrTung

MrTung posted a new question

hare • 18 hours ago

why npm run generate,no html in dist?

HI, in my app,im run "npm run generate",but no html in my dist,and im tried many times,but still no html。

plz help me!! !

node -v :10.2.1;
npm -v :5.6.0;
nuxt-edge: "latest";

zajca

zajca posted a new bug report

hare • 4 days ago

bug [edge] imported lib in nuxt.config.js is missing in generated files

Version

2.0.0-25573733.5b98c1c

Reproduction link

https://github.com/zajca/nuxt-bug-5b98c1c

Steps to reproduce

run npm run dev
there is router config for parseQuery/stringifyQuery using qs lib

What is expected ?

qs will be imported in .nuxt/router.js

What is actually happening?

function in router config is copied to router.js but not dependency

MrTung

MrTung posted a new question

hare • 5 days ago

After run "npm run generate", But here no html in dist

HI, in my app,im run "npm run generate",but no html in my dist,and im try so many times,but here is no html。

help !! !

node -v :10.2.1;
npm -v :5.6.0;
nuxt-edge: "latest";

LS1231

LS1231 posted a new question

hare • 6 days ago

Calling the this.$auth.login method does not automatically redirect to the specified page

package.json

"@nuxtjs/auth": "^4.5.1",
"nuxt": "^1.4.2"

nuxt.config.js

auth: {
strategies: {
local: {
endpoints: {
login: { url: '/user/login', method: 'post', propertyName: 'data.token' },
logout: { url: '/user/logout', method: 'post' },
user: { url: '/user', method: 'get', propertyName: 'data' }
}
}
},
localStorage: false,
cookie: {
prefix: 'auth.',
options: {
expires: 1
}
},
redirect: {
login: '/account/login',
callback: '/account/callback'
}
}

yalondpsi

yalondpsi posted a new question

hare • 7 days ago

nuxt 1.4.2 - [nuxt] Error while initializing app TypeError: c is not a constructor

I got this error and I have no clue how to resolve it
by running locally nuxt ssr - npm run dev
Please Help
Thanks
I upgraded from nuxt rc11

nicoladl

nicoladl resolved the question #c69

hare • 7 days ago

Google Tag Manager - dataLayer net::ERR_ABORTED

@besnikh have you publish your container?

besnikh

besnikh posted a new question

hare • 8 days ago

Google Tag Manager - dataLayer net::ERR_ABORTED

Hi,
I just installed Google Tag Manager module, and managed to track GA Pageviews, when I disabled the Preview mode I am getting this error in my console:
GET http://www.googletagmanager.com/gtm.js?id=GTMxxxxx&l=dataLayer net::ERR_ABORTED

I tried to do the following nuxt.conf

['@nuxtjs/google-tag-manager', { id: 'GTM-xxxxx', layer: 'dataLayer' }],

Am I missing something or this is a bug.
Please note that when I am in preview mode, the error is not showing

Thnx in advance,

roosh-t3

roosh-t3 posted a new feature request

hare • 13 days ago

idea Manully setting up user token setToken()

What problem does this feature solve?

When a token is added manually Axios doesn't attach the token. As for my auth flow it is required.

What does the proposed changes look like?

When setting a token manually using $auth.setToken calling this.$auth.ctx.app.$axios.setHeader(this.options.tokenName, token) this would solves the manual login problem.

stecapra

stecapra posted a new question

hare • 13 days ago

Cannot build nuxt application low ram

Hi,
i'm having difficulties build my application in the production server. The server has a dual core cpu with 4 GB RAM, but if i try nuxt build it runs forever, always approaching 91% of build.
Is something related with the specs? Because in my dev computer everything works fine, and i though it was because of the lower ram or cpu power.

Thanks in advance

jubin3424

jubin3424 posted a new question

hare • 14 days ago

No data passed with axios!!!

----------------------------------------------------------------------------------------------------------------------<Front Side>

<script> export default { name: "JbCoinComment", data () { return { textarea: '', comments: '', } }, created () { this.getPosts () }, methods: { addComment() { this.$axios.post('/api/comments/new', { user: 'jubin4324', content: this.textarea }) .then((response) => { console.log(response.message) }) .catch((response) => { alert('error occurred') }) }, async getPosts () { const ip = await this.$axios.$get('/api/comments') this.comments = ip.comments } }, } </script>

----------------------------------------------------------------------------------------------------------------------<Server Side>
router.post('/comments/new', (req, res) => {
let db = req.db
let currentDate = new Date()
console.log(req)
let user = req.body.user
// let content = 'oo'
// console.log(req)
let newcomment = new Comment({ user: user, content: req.body.content, createdat: currentDate
})

new_comment.save((error) => {
if (error) {
console.log(error)
}
res.send({
success: true,
message: 'Comment saved Successfully'
})
})

})

TypeError: Cannot read property 'user' of undefined!!

If I set manually user and content in server side, the new_comment is saved well.
However, I want my data passed through the axios post.
I tried to find these data in req, res but there is no data.
There is no req.body, res.body

Please help me… I want to post my input data…

andy-noir

andy-noir posted a new question

hare • 14 days ago

Extend webpack config with ImageConvertor

Hey! Can anyone review this code below ? I want my images to be converted from *png to *webp using this webpack plugin - https://github.com/kavu/webp-loader. But for some reason none of the configurations from the docs do not work

nuxt.config.js

  build: {
    extend(config, ctx) {
      // Run ESLint on save
      if (ctx.isDev && ctx.isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/,
        });
        config.module.rules.push({
          test: /\.(jpe?g|png)$/i,
          loaders: ['file-loader', 'webp-loader'],
          exclude: /(node_modules)/,
        });
      }
    },
  },
amandablakley

amandablakley posted a new bug report

hare • 20 days ago

bug Can no longer stage & push create-nuxt-app create projects that are new

Version

v0.4.0

Reproduction link

https://github.com/nuxt-community/create-nuxt-app

Steps to reproduce

Create nuxt project through terminal with npx create-nuxt-app <my-project> and follow steps.

What is expected ?

When you stage project you should be able to stage and push to github repo.

What is actually happening?

You can not stage project at all, let alone push. Gitkraken and source tree both throw errors stating they can not find master head. There were no issues with this repo prior to the last commit in the last 20 hours.

gomezmark

gomezmark posted a new question

hare • 22 days ago

Progress: false

How to add { progress : false }
when I'm passing a multi form data?

dasisyouyu

dasisyouyu posted a new question

hare • a month ago

TypeError: Cannot read property 'normalModuleFactory' of undefined
yarn versions v1.7.0
{ yarn:
   '1.7.0',
  colon_tech:
   '1.0.1',
  http_parser:
   '2.8.0',
  node:
   '10.6.0',
  v8:
   '6.7.288.46-node.13',
  uv:
   '1.21.0',
  zlib:
   '1.2.11',
  ares:
   '1.14.0',
  modules:
   '64',
  nghttp2:
   '1.32.0',
  napi:
   '3',
  openssl:
   '1.1.0h',
  icu:
   '62.1',
  unicode:
   '11.0',
  cldr:
   '33.1',
  tz:
   '2018e' }

スクリーンショット 2018-07-23 20.30.32.png

スクリーンショット 2018-07-23 20.31.56.png

what is intention this nuxt error?

nallown

nallown posted a new bug report

hare • a month ago

bug [edge] [nuxt] Error while initializing app DOMException

Version

2

Reproduction link

https://test.twist.moe/a/07-ghost/1

Steps to reproduce

  1. Go to the reproduction link
  2. Login with username: public and password: not
  3. Check Dev-Tools console

What is expected ?

The website should render fine and it should play the video.

What is actually happening?

It throws an error in the console.

Additional comments?

I tried to upgrade my nuxt version to 2.0 and I get the following error:

[nuxt] Error while initializing app DOMException: Failed to execute 'appendChild' on 'Node': This node type does not support this method.

I've updated the Nuxt version to nuxt-edge and I also updated other node modules version to work with nuxt-edge and webpack 4. I freshly installed the node_modules so I removed the folder and ran a fresh npm i. When I run the dev version of the build, it works fine. It only fails with the production build. All the unit test pass just like they did before I only started getting this error after the nuxt-edge and webpack 4 upgrade. The website works fine and everything builds without a error, there were no issues until I upgraded my project to nuxt-edge and started the nuxt server in production.

I can give you access to the repository the project is very easy to setup, the dev version of the project works without internet, it uses mock network requests for the API. Just ask and I can give you access.

15831929073

15831929073 posted a new question

hare • a month ago

nuxt 在ie8下报错 缺少标志符 字符串 或数字 Nuxt reported error in IE8, missing symbol string or number.

WechatIMG6.jpeg
Nuxt reported error in IE8, missing symbol string or number.
I tried to configure es3ify-loader, but it didn't work.
1532265969221.jpg

arifmahmudrana

arifmahmudrana posted a new question

hare • a month ago

How to create route like /posts/:id/*

In my blog for blog details page I want create a route like /posts/:id/* where id & * part will be dynamic as id suggest id will be the id of the post * is the slug. That means anything can be there or absolutely nothing.

As this is very specific I tried with google but couldn't find any solution so asking here.

Thanks for your help.

Arif Mahmud Rana

umardraz

umardraz posted a new question

hare • a month ago

Store availability issue

I have Api.js file inside middleware directory. I am trying to send Authorization token to my API url but Nuxtjs store is not available there here is my middleware/Api.js file and store/index.js

import axios from 'axios'
export default () => {
const token = store.state.auth
return axios.create({
baseURL: /api,
headers: {
Authorization: Bearer ${token}
}
})
}

store/index.js

import Vuex from 'vuex'
const cookieparser = require('cookieparser')

const createStore = () => {
return new Vuex.Store({
state: {
auth: null
},
mutations: {
update (state, data) {
state.auth = data
}
},
actions: {
nuxtServerInit ({ commit }, { req }) {
let accessToken = null
if (req.headers.cookie) {
var parsed = cookieparser.parse(req.headers.cookie)
accessToken = JSON.parse(parsed.auth)
}
commit('update', accessToken)
}
}
})
}

export default createStore

Would you please help me what is the exact issue and how I can solve this.

hopkinson

hopkinson posted a new question

hare • a month ago

How to change assetsPublicPath?

Hi~
I want to change the assetsPublicPath.
but i found nuxt just provide how to change publicPath.
Because,
the images of my project is in /static/, after npm run build, i want to change the path of this resources .
Although i know i can put those images in /assets/, and change publicPath.but i hope css,js,html no change anymore.

This question is available on Nuxt community (#c7417)
willy1412

willy1412 posted a new question

hare • a month ago

How to do Promise in NuxtJs?

I have this Axios Async Await code in Nuxt.js, I am not sure on how and where to put the Promise.all here. I am new at async await. I am trying to promise the getThemes() and getData(). Could somebody help me with the Promise.all code?

mounted() {
this.getThemes();
this.getData(this.$route.params.id);
},
methods: {

async getThemes() {
  this.loading = true;
  await axios.get(`${process.env.API_URL}/v1/communication/email-themes`, {
  }).then((response) => {
    this.theme = response.data.data;
    this.selected = this.theme.filter(t => this.themeId === t.id)[0].id;
    this.loading = false;
  }).catch((error) => {
    this.loading = false;
    this.errormsg = error.response.data.message;
  });
},

async getData(id) {
  this.loading = true;
  await axios.get(`${process.env.API_URL}/v1/communication/email-templates/${id}`)
    .then(({ data }) => {
      this.templateName = data.data.name;
      this.templateCode = data.data.content;
      this.themeId = data.data.theme_id;
      this.loading = false;
    }).catch((error) => {
      this.loading = false;
      this.errormsg = error.response.data.message;
    });
},