usb248 posted a new feature request
hare •
I have a serverMiddleware with a cookie parser with an internal API (with express).
// Export the server middleware
export default {
path: '/api',
handler: app
}
All work fine client side but when axios request is trigerred server side, axios doesn't add set-cookie. I have to do:
$axios.onResponse((resp) => {
if(resp.headers['set-cookie'] && process.server){
try{
res.setHeader('Set-Cookie', [ resp.headers['set-cookie'] ])
}catch(e) {}
}
return resp
})
Why ?
fy976061258 posted a new question
hare •
renderContext.renderResourceHints is not a function
learntolearn99 posted a new question
hare •
I cannot import tradingivew js
https://github.com/tradingview/charting-library-examples/issues/80
ducong123 posted a new question
hare •
Unable to find native implementation, or alternative implementation for WebSocket!
EmmanuelJego posted a new question
hare •
Hi!
I first started a project with Vue.js, then I discovered Nuxt.js which seems very nice, so I started to recreate my project with Nuxt.
So I wanted to import the plugins I used in my Vue.js project (especially 'vue-pdf': https://www.npmjs.com/package/vue-pdf).
If, in my vue, I try to import it like "var pdfVue = require('vue-pdf')" I got a "Unexpected token <" error. This seems rigth since vue-pdf is a pdf player, so a client-side only component.
I tried to import it as a plugin like so (as it is written in the doc at https://nuxtjs.org/guide/plugins#client-side-only):
--> vue-pdf.js:
"
import Vue from 'vue'
import VuePdf from 'vue-pdf'
Vue.use(VuePdf)
"
--> nuxt.config.js:
"
…
plugins: [
{src: '~/plugins/vue-pdf.js', ssr: false}
],
build: {
vendor: [
'vue-pdf'
]
}
…
"
With that, I have a "Uncaught ReferenceError: window is not defined" error.
I also tried "{src: '~/plugins/vue-pdf.js', mode: 'client'}" but that doesn't change anything.
I don't even try to use/import the component in any vue.
I tried it in a brand new project to start from 0, but as soon as I create the plugin, I have the error.
Am I doing something wrong? Or is the plugin not working with Nuxt? I'm pretty confused!
Thanks for your help!
mjmnagy posted a new question
hare •
I am curious as to the methodology Nuxtjs uses to register a plugin. I have been reading the documentation for Nuxt.js and i am slightly confused as to the registration methodology.
I do not want to register plugins such as vue-flag-icon globally.
My understanding is when we register the plugin we use the plugin folder as such
import Vue from 'vue'
import FlagIcon from 'vue-flag-icon'
Vue.use(FlagIcon)
I can now use the flag component anywhere in my app - i dont want this!!!
I want to be able to load plugins into the components that need them ONLY.
i have tried loading them as a component like:
components:{
'flag': ()=> import('path to plugin') // @/plugins/vue-flag-icon
}
This does not work
I changed my plugins script to
import Vue from 'vue'
import FlagIcon from 'vue-flag-icon'
export default () => {
Vue.use(FlagIcon)
}
And then tried to register the plugin within the components like so:
import flag from '@/plugins/vue-flag-icon';
created(){
flag()
}
My questions really are:
How can i register a plugin within the component without importing the vue instance (i think is called a bus)
Is it bad practice to import the plugins directly into components
Is registering all the plugins within nuxt.config.js creating a larger download file for users to download( example: registering vue-twix is not necessary on pages that do not have textareas) or will nuxt/webpack handle the removal of unnecessary plugins on a page by page or component by component basis (so i dont have to even worry about this). If this is the case than i dig nuxt
parthibansettu posted a new question
hare •
Node.js Version: 8.12.0
OS: Windows
Hi I am using Javascript with cucumber and i am trying to add debug feature in the framework using VScode and i am facing "C:\Program Files\nodejs\npm.cmd run-script debug
Debugger listening on ws://127.0.0.1:1337/3a70b3dd-3378-4eae-8517-405e3ae9f3ba"
When i click on "debug" browser is not triggered
Here is my launch.json file
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug",
"runtimeExecutable": "npm.cmd",
"cwd": "${workspaceRoot}/nodal/",
"env":{
"NODEPATH": "${workspaceRoot}/nodal/nodemodules"
},
"runtimeArgs": [
"run-script", "debug"
],
"port": 1337
}
]
}
Here is my package.json file
{
"name": "nodal",
"version": "1.1.5",
"description": "End to end UI test automation framework using node,es6,wdio and cucumber",
"main": "index.js",
"scripts": {
"test": "node nodemodules/webdriverio/bin/wdio ./config/runconf.js",
"suitetest": "node nodemodules/webdriverio/bin/wdio ./config/runconf.js --suite login",
"inspect-test": "node nodemodules/webdriverio/bin/wdio ./config/runconf.js --inspect",
"allure-report": "nodemodules/.bin/allure generate ./reports/allure-results -c && allure open",
"test1": "npm run test && npm run allure-report",
"junit-report": "nodemodules/.bin/junit-viewer --results=./reports/junit-results --save=junit-results.html && open junit-results.html",
"build": "babel featuregenerator/server.js",
"start-feature": "nodemon featuregenerator/server.js --exec babel-node",
"start-runner": "nodemon testrunnerandreportgenerator/server.js --exec babel-node",
"debug": "node --inspect=1337 --debug-brk --nolazy nodemodules/cucumber/bin/cucumber-js --tags @debug --format json:./reports/report.json"
},
"author": "TAA",
"license": "AthenaHealth",
"dependencies": {
"4": "0.0.0",
"@athena/app-fabric-logger": "^3.0.0",
"@athena/iam-service-token-manager": "^1.1.1",
"@sinonjs/formatio": "^3.2.1",
"allure-commandline": "^2.5.0",
"assert": "^1.5.0",
"axios": "^0.18.0",
"babel-cli": "^6.26.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.0",
"babel-preset-es2015": "^6.24.1",
"babel-register": "^6.26.0",
"body-parser": "^1.19.0",
"cookie-parser": "^1.4.3",
"cucumber": "^5.0.2",
"date-time": "^2.1.0",
"express": "^4.16.4",
"graceful-fs": "^4.1.11",
"hoek": "^6.1.3",
"js-yaml": "^3.13.1",
"json-to-pretty-yaml": "^1.2.2",
"json2yaml": "^1.1.0",
"multer": "^1.4.1",
"node-yaml": "^3.2.0",
"opn": "^5.5.0",
"qs": "^6.7.0",
"random-string-generator": "^0.2.0",
"regex": "^0.1.1",
"replace-ext": "1.0",
"rgb-hex": "^2.1.0",
"rgba-convert": "^0.3.0",
"selenium-grid": "^0.5.0",
"tar": "^4.4.6",
"wdio-allure-reporter": "^0.6.0",
"wdio-dot-reporter": "0.0.5",
"wdio-json-reporter": "^0.1.1",
"wdio-junit-reporter": "0.0.2",
"wdio-spec-reporter": "^0.1.2",
"yawn-yaml": "^1.4.0"
},
"devDependencies": {
"chromedriver": "^2.42.0",
"eslint": "^5.16.0",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-node": "^5.1.1",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-react": "^3.16.1",
"eslint-plugin-standard": "^3.0.1",
"inspect-brk": "^0.1.2",
"node-cmd": "^3.0.0",
"node-dir": "^0.1.17",
"node-uuid": "^1.4.7",
"nodemon": "^1.19.0",
"open": "^6.3.0",
"selenium-standalone": "^6.16.0",
"wdio-chromedriver-service": "~0.1",
"wdio-cucumber-framework": "^1.1.1",
"wdio-screenshot": "^0.5.0",
"wdio-selenium-standalone-service": "^0.0.10",
"webdriverio": "4.13.2"
},
"babel": {
"presets": [
[
"env",
{
"targets": {
"node": "current"
}
}
]
],
"plugins": [
"transform-object-rest-spread"
]
},
"nodemonConfig": {
"ignore": [
"./config",
"./reports",
"./allure-report",
"./pageobjects",
"./step_definitions"
]
}
}
can you tell me how to fix this issue ?
AlexBa posted a new bug report
hare •
https://alexanderbarton.de/sitemap.xml
Just generate the sitemap with the config. :)
Routes in sitemap without the /_nuxt/ prefix
Routes in sitemap with /_nuxt/ prefix
This is my nuxt.config.js:
const pkg = require('./package');
const dotenv = require('dotenv');
dotenv.config();
module.exports = {
mode: 'universal',
/*
** Headers of the page
*/
head: {
title: pkg.name,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: pkg.description }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
]
},
/*
** Customize the progress-bar color
*/
loading: false,
/*
** Global CSS
*/
css: [
'~assets/scss/style.scss',
],
/*
** Plugins to load before mounting the App
*/
plugins: [
{src: '~plugins/bootstrap-native', ssr: false},
{src: '~plugins/tiny-slider', ssr: false}
],
/*
** Nuxt.js modules
*/
modules: [
'@nuxtjs/dotenv',
'@nuxtjs/axios',
'@nuxtjs/redirect-module',
['@nuxtjs/google-tag-manager', {
id: process.env.GTMCONTAINERID
}],
['nuxt-i18n', {
strategy: 'prefixexceptdefault',
defaultLocale: 'de',
lazy: true,
langDir: 'translations/',
locales: [
{
code: 'de',
file: 'de.json'
}
],
}],
'@nuxtjs/sitemap'
],
axios: {
// proxyHeaders: false
},
redirect: [
{ from: '^/datenschutz-erklaerung', to: '/datenschutz' }
],
/*
** Build configuration
*/
build: {
extend(config) {
config.module.rules.push({
test: /bootstrap.native/,
use: {
loader: 'bootstrap.native-loader',
options: {
only: ['collapse', 'modal']
}
}
});
}
}
};
Lisiadito posted a new bug report
hare •
https://github.com/nuxt/http/blob/dev/types/index.d.ts
Using the @nuxt/http module with TypeScript leads to an error Cannot find name 'JSONValue'
Compilation works without problems
Error Cannot find name 'JSONValue'
because the type is used but not imported
joergac posted a new question
hare •
I am actually considering using this package but it seems like it's been abandoned from the maintainers? That are many PRs that haven't been addressed at all and half the issues have not been answered.
I am not criticizing the work here and I respect that this is a community package. I am just asking if this is considered to be just that or if it is under active development..
shahzaibanwar009 posted a new question
hare •
config with miniToaster in nuxt app
I installed vue-notification plugin and configured it.it is working fine
i wanna add mini-toaster how to setup mini-toaster
seybsen posted a new question
hare •
[deleted]
alanaasmaa posted a new feature request
hare •
Hello,
I have tried to fight with this issue couple of times for now.
I have a page running on default layout.
The page contains a form that will switch form with success page after filling.
Sometimes users would like to refresh the page by clicking the logo/router-link.
But when current page is active the router wont refresh the page.
How could i do that?
I have tried to add :key to everywhere.
I found this but not working => https://github.com/nuxt/nuxt.js/issues/2285
I think it would be good to have a option for template. That by default wont allow refreshing/reloading and when re clicking it reloads.
RafaelGSS posted a new question
hare •
Hello everyone.
I would like use meanmenu jQuery on my application NuxtJS. But, i don't understanding how to work the plugins.
I trying like bellow:
nuxt.config.js
plugins:[
'~plugins/meanmenu-import'
]
plugins/meanmenu-import.js
import Vue from 'vue'
import * as js from 'meanmenu.js'
Vue.use(js);
plugins/meanmenu.js
The raw content of: https://github.com/meanthemes/meanMenu/blob/master/jquery.meanmenu.js
Just copy paste.
--
I using on content like:
export default {
mounted() {
/* jQuery MeanMenu */
$('#mobile-menu-active').meanmenu({
meanScreenWidth: "991",
meanMenuContainer: ".mobile-menu-area .mobile-menu",
});
}
}
And receive the error:
$(...).meanmenu is not a function
JasonGaoG posted a new question
hare •
I don't have Ant Design Vue UI framework choice when I use create-nuxt-app to init project, Below is the choice list:
? Use a custom UI framework
none
bootstrap
vuetify
bulma
tailwind
element-ui
buefy
Hxmic posted a new question
hare •
Hello everyone .My project upgrade 1.0 to 2.0, According to this steps , first I delete node_modules .nuxt.js and package-lock.json, then npm upgrade , npm install finally npm run dev,
This is new error
in ./.nuxt/client.js friendly-errors 19:45:27
Module build failed (from ./nodemodules/@nuxt/webpack/nodemodules/babel-loader/lib/index.js): friendly-errors 19:45:27
Error: Plugin/Preset files are not allowed to export objects, only functions.
msymms posted a new question
hare •
I have reviewed the comments in c6898 and still am a little confused. I have an asyncData call in nuxtServerInit loading an array and storing in the store. I have code that needs to be run in four separate components and wanted to combine this into a plugin/mixin. However, this code (which of course works fine in the component locally) requires access to the store. I get an error stating the prop 'getters' is undefined. Here is the js code for the methods/mixin.
util.js
getCategories (categories) {
const loadedCategories = this.$store.getters.loadedCategories;
let categoryNames = [];
for (let idx in loadedCategories) {
for (let cIdx in categories) {
if (loadedCategories[idx].uuid === categories[cIdx]) {
categoryNames.push(loadedCategories[idx].name);
console.log(loadedCategories[idx].name);
}
}
}
return categoryNames;
}
plugin code (main.js)
import Vue from 'vue'
import util from '~/static/js/util.js'
Vue.mixin({
methods: {
listCategories(categories) {
util.getCategories(categories)
}
}
})
Again, I load the required array in the nuxtServerInit action and commit it to the store
Is the store available at this stage of the lifecycle??
TIA
podlebar posted a new bug report
hare •
https://gist.github.com/podlebar/c3199368b0ff026d0454e2c77115297f
Install nuxt pwa module as described in the docs. Add a 512px icon.png to static folder.
icon prop should be array without size
the icon prop gets the size of the icons array passed. mainfest.json is not valid anymore
brandonpittman posted a new bug report
hare •
Add '@nuxtjs/axios' to nuxt.config.js
Should display content files
Can't find page
aaaguirrep posted a new question
hare •
Hi, i am not a developer but i am deploying a web application using nuxt and i have a doubt about load all information related to the users once in the application, all the information is managed by vuex. I need to load all information after the authentication process because i am showing a dashboard to the user. I have read and found the next options but i don't know where is the best practice without impact the performance of the application:
1.- Load all information in the same vuex action where the user authenticates. I have an action to validate the user and password and it creates the cookies and token sessions. I can load all information in the same action but the authentication process could be slower. With this option the load of information is executed just once.
2.- Load all information in the main/dashboard component by the fetch function consuming an vuex action (do a dispatch). It works but i am seeing that when i browse to the main/dashboard component the fetch function is always appearing. Load of information should be once after the authentication process.
3.- I also am using the nuxtserverinit to load all information when the users press F5 button or reload the web application but if i do a reload in the main/dashboard component i am seeing nuxtserverinit and fetch functions . I am duplicating resources.
I really appreciate your help.
Thanks in advance.
Regards,
Arsenio