Coder Social home page Coder Social logo

nuxt-community / express-template Goto Github PK

View Code? Open in Web Editor NEW
1.2K 21.0 239.0 164 KB

Starter template for Nuxt 2 with Express.

Home Page: https://codesandbox.io/s/github/nuxt-community/express-template

JavaScript 31.36% Vue 68.64%
nuxt express nuxt-template vue expressjs

express-template's People

Contributors

alexchopin avatar astv99 avatar atinux avatar beastia avatar clarkdo avatar detrohutt avatar farnabaz avatar gabrielfcc avatar gamelaster avatar guumaster avatar harlan-zw avatar juscilan avatar merodiro avatar ndarilek avatar renovate-bot avatar renovate[bot] avatar schoonc avatar scottcorgan avatar stanleymasinde avatar tom-richter avatar ultrajeff avatar umbrella-anton-karmazin avatar uptownhr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

express-template's Issues

Debugging - breakpoints not being hit

I'm trying to debug this with Visual Studio Code. I have breakpoints set in the get methods in users.js, but none of the breakpoints are being hit. My launch.json looks like this:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Launch Program",
      "program": "${workspaceRoot}\\build\\main.js"
    }
  ]
}
This feature request is available on Nuxt.js community (#c22)

Crash with Vuetify

Before adding backpack this template worked ok with Vuetify. But now it crash when it tries to load *.styl files. When I run npm run dev throws this is the error:

* !!vue-style-loader!css-loader!../node_modules/vue-loader/lib/style-compiler/index?{"id":"data-v-216ea150","scoped":false,"hasInlineConfig":true}!stylus-loader!css/app.styl in ./.nuxt/App.vue

To install it, you can run: npm install --save !!vue-style-loader!css-loader!../node_modules/vue-loader/lib/style-compiler/index?{"id":"data-v-216ea150","scoped":false,"hasInlineConfig":true}!stylus-loader!css/app.styl

This is part of my nuxt.config.js that worked previously:

  //...
  plugins: ['~plugins/vuetify.js'],
  css: [
    {src: join(__dirname, 'css/app.styl'), lang: 'styl'}
  ],
  build: {
    vendor: ['vuetify', 'axios'],
  //....

I'm not sure how to fix it. Does backpack need the vue-loader config? Which part of the config should be updated?

This question is available on Nuxt.js community (#c20)

Req.url has wrong value

I cannot understand why 'req.url' always has buggy behavior.

I just initialized new project with vue init nuxt/express . && yarn
Then i've removed server/api/users.js and remove including require('users') from server/api/index.js

my server/index.js
image

my server/api/index.js
image

No references to users, right?
But,

  1. when i make request to http://127.0.0.1:3000/foo it shows in terminal /users/foo
  2. when i make request to http://127.0.0.1:3000/api/foo it shows in terminal /foo
  3. when i make request to http://127.0.0.1:3000/foo/bar it shows in terminal nothing, but redirects to 404

Cannot understand 1 and 2 behavior
Looks like a bug

This question is available on Nuxt.js community (#c26)

block-scoped declarations error

Do i need to run through babel? I'm using node v7.x.

npm run dev

> [email protected] dev /home/uptown/Projects/Opensource/nuxt-express
> nodemon --exec babel-node -w server.js -w nuxt.config.js -w api/ server.js

[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: server.js nuxt.config.js /home/uptown/Projects/Opensource/nuxt-express/api/**/*
[nodemon] starting `babel-node server.js`
/home/uptown/Projects/Opensource/nuxt-express/node_modules/vue-ssr-html-stream/index.js:4
class HTMLStream extends Transform {
^^^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Module._extensions..js (module.js:416:10)
    at Object.require.extensions.(anonymous function) [as .js] (/home/uptown/Projects/Opensource/nuxt-express/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/uptown/Projects/Opensource/nuxt-express/node_modules/vue-server-renderer/build.js:6764:18)
    at Module._compile (module.js:409:26)
[nodemon] app crashed - waiting for file changes before starting...
This question is available on Nuxt.js community (#c9)

How to integrate ESlint?

Hi guys

I have a function that I can it run Nuxt in Sails.JS (with Express). My ask is, how to integrate ESlint (for nuxt - vue ) in this point?

customMiddleware: function (app) {
  const Nuxt = require('nuxt')
  let config = require('../nuxt.config.js')

  const nuxt = new Nuxt(config)
  config.dev = !(process.env.NODE_ENV === 'production')
  app.use(nuxt.render)
  if (config.dev) {
    nuxt.build()
    .catch((error) => {
      console.error(error)
      process.exit(1)
    })
  }
}

Thanks

This question is available on Nuxt.js community (#c19)

jwt token

hi,
can this template work with laravel apis and jwt auth?

This question is available on Nuxt.js community (#c12)

How to debug with node-inspector

I want to debug node server side code, I have tried add '--debug' or '--inspect' or node-inspector, no matter which way still can not debug node server side code. Please tell me how to go it

This question is available on Nuxt.js community (#c36)

Error when init the project

Hello,

I have this error just create project:

(node:180) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: app.use() requires middleware functions

Steps:

  • vue init nuxt/express project-name
  • yarn
  • npm run dev

NODE_ENV variable is undefined.
Nuxt is installed globally.

The machine is Windows 10.
I try with node 6.9.5 and 8.0.0 and get same error.

This question is available on Nuxt.js community (#c34)

TypeError: app.use() requires middleware functions (using nuxt ^1.0.0-alpha.3)

import Nuxt from 'nuxt'
import express from 'express'

const app = express()
const host = process.env.HOST || '127.0.0.1'
const port = process.env.PORT || 3000

app.set('port', port)

// Start nuxt.js
async function start() {
  // Import and Set Nuxt.js options
  let config = require('../nuxt.config.js')
  config.dev = !(process.env.NODE_ENV === 'production')
  // Instanciate nuxt.js
  const nuxt = new Nuxt(config)
  // Add nuxt.js middleware
  app.use(nuxt.render) # !!!!! error here (seems like) !!!!!!!
  // Listen the server
  app.listen(port, host)
  console.log('Server listening on ' + host + ':' + port) // eslint-disable-line no-console
}

start()

full error on yarn run dev

 DONE  Compiled successfully in 65ms                                                                                          9:44:32 PM

(node:11837) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: app.use() requires middleware functions
This question is available on Nuxt.js community (#c44)

How to start with passportjs ?

I build a login with github?
Code:
index.js
`import Nuxt from 'nuxt'
import express from 'express'
var session = require('express-session');
var passport = require('passport');
var GitHubStrategy = require('passport-github2').Strategy;
require('dotenv').config()

var GITHUB_CLIENT_ID = "d31b61d6f66614bae0cf";
var GITHUB_CLIENT_SECRET = "7fbd3cd8ee9b9f367d05488c8d83838b675a7532";

import api from './api'

const app = express()
const host = process.env.HOST || '127.0.0.1'
const port = process.env.PORT || 3000

passport.serializeUser(function(user, done) {
done(null, user);
});

passport.deserializeUser(function(obj, done) {
done(null, obj);
});

app.set('port', port)

// Import API Routes
app.use('/api', api)

passport.use(new GitHubStrategy({
clientID: GITHUB_CLIENT_ID,
clientSecret: GITHUB_CLIENT_SECRET,
callbackURL: "http://localhost:8080/api/auth/github/callback"
},
function(accessToken, refreshToken, profile, done) {
// asynchronous verification, for effect...
process.nextTick(function () {
return done(null, profile);
});
}
));
app.use(session({ secret: 'keyboard cat', resave: true, saveUninitialized: true }));
app.use(passport.initialize())
app.use(passport.session())

// Start nuxt.js
async function start() {
// Import and Set Nuxt.js options
let config = require('../nuxt.config.js')
config.dev = !(process.env.NODE_ENV === 'production')
// Instanciate nuxt.js
const nuxt = new Nuxt(config)
// Add nuxt.js middleware
app.use(nuxt.render)
// Listen the server
app.listen(port, host)
console.log('Server listening on ' + host + ':' + port) // eslint-disable-line no-console
}

start()
`

auth.js

`import { Router } from 'express'
var passport = require('passport');
var router = Router()

router.get('/auth/github', passport.authenticate('github', { scope: [ 'user:email' ] }));

router.get('/auth/github/callback', passport.authenticate('github', { failureRedirect: '/' }),
function(req, res) {
// Successful authentication, redirect home.
res.redirect('/');
});

export default router
`

but router.get('/auth/github/callback' not working. please help me!!!!

This question is available on Nuxt.js community (#c39)

npm run dev doesn't work

After cloning the template using vue-cli and running npm install, I ran into this error (check the included picture). So, I deleted the folder and redid the whole thing, but used yarn instead, and I'm still getting the same error!
screenshot from 2017-07-10 19-35-43

This question is available on Nuxt.js community (#c42)

How to use nuxt on production?

Hi guys

I need to show my nuxt server in a middleware, but you show the nuxt.build in this page L25 in the development enviroment. However I need an example of nuxt in a production enviroment.
Can somebody help me?

This question is available on Nuxt.js community (#c23)

could i get express req object inside asyncData?

just like this

async asyncData (ctx) {
  // expect an express req object(https://expressjs.com/en/4x/api.html#req)
  // not NodeAPI incomeMessage (https://nodejs.org/api/http.html#http_class_http_incomingmessage)
  console.log(ctx.req) 
}

any suggestion?

This question is available on Nuxt.js community (#c32)

Error with Node 8

I have Node v8.1.2, after running npm run dev

Error:
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: app.use() requires middleware functions

The problem is here: app.use(nuxt.render)
With Node 7.* is working properly.

This question is available on Nuxt.js community (#c37)

about ssr-cookie

export default function({isServer, req}) {
  if (isServer) {
    axios.defaults.headers.common.cookie = req.headers.cookie
  }
}

I see ssr-cookie.js, It set the global cookie from req.

How to ensure each req context use the same cookie?

This question is available on Nuxt.js community (#c45)

environment

Where can I learn more about the new environment of the current build?
It is not clear why duplication of code was done in the directory server

This question is available on Nuxt.js community (#c21)

How do I change port to 80 on production???

I have an error:
Error: connect ECONNREFUSED 127.0.0.1:3000
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)

This question is available on Nuxt.js community (#c31)

New Install Error

Hi After installing Nuxt + Express template and then run npm run dev, following is what I am getting.

(node:11558) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: app.use() requires middleware functions
This question is available on Nuxt.js community (#c35)

[Help] Retrieve the host / BaseURI / origin of request

I am wondering whether there is a way to get the host of the application with this setup. I think that in NuxtJS standalone you can call this.origin although I'm not sure now whether it returned the hostname when rendered client-side or server-side.

I tried looking at the baseURI of an element, but of course when rendered from the server, this isn't available.

Basically I'm just trying to create a simple function to determine a path to an API depending on if I'm in development or production. This is my mixin:

let mixins = {
  methods: {
    apiUrl: function (src) {
      let baseURI = 'http://example.com'
      return (process.env.NODE_ENV !== 'production' ? (baseURI + ':9000') : baseURI.replace('//', '//api.')) + '/' + src
    }
  }
}

exports.mixin = mixins

So basically in development it'd output http://developmentdomain.com:9000/path/to/call and production would be https://api.productiondomain.com/path/to/call

I know the NODE_ENV is not available in development, but that's OK because it is in production so that bit works. But if I use HOST then it works on server-side calls, and this['$el'].baseURI would work on client-side but it seems a bit hacky and I'm hoping there's something simple I'm missing because I'm new to this.

Thanks in advance for any advice.

This question is available on Nuxt.js community (#c41)

`npm run start` does not work in windows environment

The command NODE_ENV=production node server.js will through an error in windows. I changed it to set NODE_ENV=production&& node server.js and things seem to work fine.

Note: Not having a whitespace after the word production is required to make this work.

I believe this command should also work under linux environments, but I can't test this.

Can we do something so that this works on windows by default?

This question is available on Nuxt.js community (#c3)

backpack-core install error!

D:\Personal\Desktop\gaga-old>npm install backpack-core -g
npm ERR! Unexpected end of input at 1:19311
npm ERR! s":{"babel-runtime":"^5.0.0"},"devDependencies":{"babel-helper-fixtur
npm ERR!                                                                      ^

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\340089\AppData\Roaming\npm-cache\_logs\2017-06-16T02_33_02_295Z-debug.log
This question is available on Nuxt.js community (#c33)

Unit test

i tried to implement unit test based on nuxt.org but i think we need different approach like test for express routes. is there any best approaches for unit test

This question is available on Nuxt.js community (#c30)

Use coffeescript for API

Hi there,

is there a simple way to use coffeescript (.coffee) to write the API within nuxt/express?

This question is available on Nuxt.js community (#c18)

Why does the build repeat itself over and over again?

This is after a fresh install:

~/Desktop/webProjects/nuxt $ npm run dev

> [email protected] dev /home/user/Desktop/webProjects/nuxt
> nodemon --exec babel-node -w server.js -w nuxt.config.js -w api/ server.js

[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: server.js nuxt.config.js /home/user/Desktop/webProjects/nuxt/api/**/*
[nodemon] starting `babel-node server.js`
Server listening on 127.0.0.1:3000
  build [=         ] 10%(node:10697) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
Build completed in 2.438s

webpack built b17535a681f8d6c520b0 in 2439ms
webpack building...

Build completed in 0.139s

webpack built b17535a681f8d6c520b0 in 140ms
webpack building...

Build completed in 0.111s

webpack built b17535a681f8d6c520b0 in 111ms
webpack building...

Build completed in 0.098s

webpack built b17535a681f8d6c520b0 in 99ms
webpack building...

Build completed in 0.142s

webpack built b17535a681f8d6c520b0 in 143ms
webpack building...

Build completed in 0.158s

webpack built b17535a681f8d6c520b0 in 159ms
webpack building...

Build completed in 0.11s

webpack built b17535a681f8d6c520b0 in 109ms
webpack building...

Build completed in 0.099s

webpack built b17535a681f8d6c520b0 in 99ms
webpack building...

Build completed in 0.1s

webpack built b17535a681f8d6c520b0 in 100ms
webpack building...

Build completed in 0.103s

webpack built b17535a681f8d6c520b0 in 104ms
webpack building...

Build completed in 0.105s

webpack built b17535a681f8d6c520b0 in 105ms
webpack building...

Build completed in 0.099s

webpack built b17535a681f8d6c520b0 in 98ms
webpack building...

Build completed in 0.089s

webpack built b17535a681f8d6c520b0 in 89ms
webpack building...

Build completed in 0.091s

webpack built b17535a681f8d6c520b0 in 91ms
webpack building...

Build completed in 0.116s

webpack built b17535a681f8d6c520b0 in 116ms
webpack building...

Build completed in 0.106s

webpack built b17535a681f8d6c520b0 in 105ms
webpack building...

Build completed in 0.112s

webpack built b17535a681f8d6c520b0 in 113ms
webpack building...

Build completed in 0.089s

webpack built b17535a681f8d6c520b0 in 89ms
webpack building...

Build completed in 0.098s

webpack built b17535a681f8d6c520b0 in 98ms
webpack building...

Build completed in 0.088s

webpack built b17535a681f8d6c520b0 in 88ms
webpack building...

Build completed in 0.133s

webpack built b17535a681f8d6c520b0 in 133ms
webpack building...

Build completed in 0.144s

webpack built b17535a681f8d6c520b0 in 144ms
webpack building...

Build completed in 0.109s

webpack built b17535a681f8d6c520b0 in 109ms
webpack building...

Build completed in 0.093s

webpack built b17535a681f8d6c520b0 in 93ms
webpack building...

Build completed in 0.046s

webpack built b17535a681f8d6c520b0 in 46ms


This question is available on Nuxt.js community (#c16)

https on localhost

I've done this in other node projects before. New to Nuxt but thought it'd be similar.

import Nuxt from 'nuxt'
import express from 'express'

import api from './api'

const app = express();
const host = process.env.HOST || 'localhost';
const port = process.env.PORT || 3000;
const https = require("https");
const fs = require("fs");
const serverConfig = require('./config.json')[process.env.NODE_ENV || 'development'];

const pkey = fs.readFileSync(serverConfig.HTTPS_KEY);
const pcert = fs.readFileSync(serverConfig.HTTPS_CERT);
const httpsOptions = {
    key: pkey,
    cert: pcert
};

app.set('port', port);

// Import API Routes
app.use('/api/v1', api);

// Start nuxt.js
async function start() {
  // Import and Set Nuxt.js options
  let config = require('../nuxt.config.js')
  config.dev = !(process.env.NODE_ENV === 'production')
  // Instanciate nuxt.js
  const nuxt = new Nuxt(config)
  // Add nuxt.js middleware
  app.use(nuxt.render)
  // Listen the server
  https.createServer(httpsOptions, app).listen(port, host);
  console.log('Server listening on ' + host + ':' + port) // eslint-disable-line no-console
}

start()

When I run this the /api/v1/users endpoint and all other API endpoints work, but when I go to https://localhost:3000 it gives me:

Error: socket hang up
    at createHangUpError (_http_client.js:302:15)
    at Socket.socketOnEnd (_http_client.js:394:23)
    at emitNone (events.js:91:20)
    at Socket.emit (events.js:188:7)
    at endReadableNT (_stream_readable.js:975:12)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Been digging around for a couple of days but no luck. Anyone have a clue to get me started down the right path?

This question is available on Nuxt.js community (#c43)

pm2 cluster_mode issue

Node 6.9.4
pm2 2.4.2
windows 10 64bit
16 gig ram

in fork mode works perfect

but when use cluster mode:

pm2 start server.prod.js -i max --env production

some instances stopped !

pm2

This question is available on Nuxt.js community (#c5)

Server logging

Hello,
Is there a way to see server logs while running this with npm run dev, or do server logs only get outputted in production?

This question is available on Nuxt.js community (#c27)

TypeError: app.use() requires middleware functions

After updating nuxt, such an error
Rollback to previous versions of the results did not give

When commenting line app.use(nuxt.render), the error disappears, and as a result, there is no rendering
The conclusion that the error is explicitly missing in my code

What do I need to do to fix it?

This question is available on Nuxt.js community (#c29)

Loop webpack building

Hi, I am not sure if this is a issue, but when I try to run npm run dev, there is seems like a bundle of loop webpack building instead of only one time building. (See the gif image below)
Why it takes too many building step? Please help, thank you guys!

Windows 10
# node -v
v7.3.0
# yarn version
yarn version v0.20.3
# npm -v
3.10.10
# vue -V
2.8.1

event

This question is available on Nuxt.js community (#c4)

Routing issues after deploy

So I cloned this template (didn't change any code) and deployed via now to here --> https://nuxt-express-dmdndmadiv.now.sh.

This could just be my misunderstanding of how express / nuxt work together, but the <nuxt-link>s never work as it looks to be trying to load the /api route(s) via localhost:3000.

image

But, a full page refresh on user 0 https://nuxt-express-dmdndmadiv.now.sh/0 works just fine.

Could this be an axios issue too?

This question is available on Nuxt.js community (#c14)

ElementUI Vue components i18n issues

I'm trying to integrate ElementUI with Nuxt and I found a weird problem related with components who use i18n terms (locale strings).

First I thought was something related with Nuxt itself but I ran the same test based on starter template and worked as expected.

Here my plugins/element-ui.js file:

import Vue from 'vue';

const ElementUI = require('element-ui');
const locale = require('element-ui/lib/locale/lang/pt-br');

Vue.use(ElementUI, { locale });

When I add the datepicker component using starter template I got this:
(everything works as expected)

Datepicker running with starter template

As you can see, all strings are loaded in Brazilian Portuguese: Month name, week days, today (hoje)

But if I try to use the same template on Express template I got this:

Datepicker running with express template
AS you can see all strings disappeared.

In both examples I used this snippet here

<template>

    ...

    <div id="app">
      <el-form ref="form" :model="form" label-width="120px">
        <el-form-item label="Activity name">
          <el-input v-model="form.name"></el-input>
        </el-form-item>
        <el-form-item label="Activity time">
          <el-col :span="11">
            <el-date-picker type="date" placeholder="Pick a date" v-model="form.date1" style="width: 100%;"></el-date-picker>
          </el-col>
          <el-col class="line" :span="2">-</el-col>
          <el-col :span="11">
            <el-time-picker type="fixed-time" placeholder="Pick a time" v-model="form.date2" style="width: 100%;"></el-time-picker>
          </el-col>
        </el-form-item>
        <el-form-item label="Instant delivery">
          <el-switch on-text="" off-text v-model="form.delivery"></el-switch>
        </el-form-item>
        <el-form-item label="Activity type">
          <el-checkbox-group v-model="form.type">
            <el-checkbox label="Online activities" name="type"></el-checkbox>
            <el-checkbox label="Promotion activities" name="type"></el-checkbox>
            <el-checkbox label="Offline activities" name="type"></el-checkbox>
            <el-checkbox label="Simple brand exposure" name="type"></el-checkbox>
          </el-checkbox-group>
        </el-form-item>
        <el-form-item label="Resources">
          <el-radio-group v-model="form.resource">
            <el-radio label="Sponsor"></el-radio>
            <el-radio label="Venue"></el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="Activity form">
          <el-input type="textarea" v-model="form.desc"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">Create</el-button>
          <el-button>Cancel</el-button>
        </el-form-item>
      </el-form>
    </div>
  </section>
</template>

<script>
  export default {
    head() {
      return {
        title: 'Index',
      };
    },

    data() {
      return {
        form: {
          name: '',
          region: '',
          date1: '',
          date2: '',
          delivery: false,
          type: [],
          resource: '',
          desc: '',
        },
      };
    },

    methods: {
      onSubmit() {
        console.log('submit!');
      },
    },
  };
</script>

In both environments I'm using the latest ElementUI version. Anybody have the same issue? Is something I'm doing wrong?

PS: Doesn't matter if I'm requesting the datepicker from the server (hard reload) or via client (navigating between links)

Thanks in advance,

This question is available on Nuxt.js community (#c50)

Problem on windows

Hello!
I know that it's not the best idea to work on Windows but I have problem:

This dependency was not found:

* plugins/axios in ./plugins/axios.js

To install it, you can run: npm install --save plugins/axios


This relative module was not found:

* ./plugins/axios in ./~/babel-loader/lib?{"presets":["vue-app"],"babelrc":false,"cacheDirectory":true}!./~/vue-loader/lib/selector.js?type=script&index=0!./pages/_id.vue
This question is available on Nuxt.js community (#c24)

little information errors

there is a list of errors
I can understand where to look for a mistake?
you can add more debug information?

logs from pm2

TypeError: Cannot read property 'join' of undefined
    at _callee$ (__vue_ssr_bundle__:8511:60)
    at tryCatch (__vue_ssr_bundle__:10094:40)
    at Generator.invoke [as _invoke] (__vue_ssr_bundle__:10329:22)
    at step (__vue_ssr_bundle__:272:30)
    at __vue_ssr_bundle__:283:13
    at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:129:7)
You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
TypeError: Cannot read property 'join' of undefined
    at _callee$ (__vue_ssr_bundle__:8511:60)
    at tryCatch (__vue_ssr_bundle__:10094:40)
    at Generator.invoke [as _invoke] (__vue_ssr_bundle__:10329:22)
    at step (__vue_ssr_bundle__:272:30)
    at __vue_ssr_bundle__:283:13
    at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:129:7)
You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
TypeError: Cannot read property 'join' of undefined
    at _callee$ (__vue_ssr_bundle__:8511:60)
    at tryCatch (__vue_ssr_bundle__:10094:40)
    at Generator.invoke [as _invoke] (__vue_ssr_bundle__:10329:22)
    at step (__vue_ssr_bundle__:272:30)
    at __vue_ssr_bundle__:283:13
    at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:129:7)
You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
TypeError: Cannot read property 'join' of undefined
    at _callee$ (__vue_ssr_bundle__:8511:60)
    at tryCatch (__vue_ssr_bundle__:10094:40)
    at Generator.invoke [as _invoke] (__vue_ssr_bundle__:10329:22)
    at step (__vue_ssr_bundle__:272:30)
    at __vue_ssr_bundle__:283:13
    at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:129:7)
You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
TypeError: Cannot read property 'join' of undefined
    at _callee$ (__vue_ssr_bundle__:8511:60)
    at tryCatch (__vue_ssr_bundle__:10094:40)
    at Generator.invoke [as _invoke] (__vue_ssr_bundle__:10329:22)
    at step (__vue_ssr_bundle__:272:30)
    at __vue_ssr_bundle__:283:13
    at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:129:7)
You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
Error: Request failed with status code 404
    at createError (/node_www/video-public.ru_express/node_modules/axios/lib/core/createError.js:15:15)
    at settle (/node_www/video-public.ru_express/node_modules/axios/lib/core/settle.js:18:12)
    at IncomingMessage.handleStreamEnd (/node_www/video-public.ru_express/node_modules/axios/lib/adapters/http.js:186:11)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:186:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:122:9)
Channel is already closed can't broadcast error:
TypeError: Converting circular structure to JSON
    at JSON.stringify (<anonymous>)
    at process.target._send (internal/child_process.js:639:23)
    at process.send (/usr/lib/node_modules/pm2/lib/ProcessContainer.js:54:42)
    at process.uncaughtListener (/usr/lib/node_modules/pm2/lib/ProcessContainer.js:276:19)
    at emitTwo (events.js:106:13)
    at process.emit (events.js:192:7)
    at emitPendingUnhandledRejections (internal/process/promises.js:85:22)
    at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:130:7)
This question is available on Nuxt.js community (#c10)

production server

After building the project, how to properly connect your production server?
i are talking about (link)

This question is available on Nuxt.js community (#c7)

node:14724) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be

> backpack dev

(node:14724) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.


 DONE  Compiled successfully in 1633ms                                                                               12:48:45 AM
module.js:472
    throw err;
    ^

Error: Cannot find module 'F:\OP\My blog\"F:\OP'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:423:7)
    at startup (bootstrap_node.js:147:9)
    at bootstrap_node.js:538:3

getting these errors when trying to run npm run dev

This question is available on Nuxt.js community (#c28)

babel dependencies may be listed incorrectly causing deployment failures to Heroku

In order to use Heroku's Nodejs build pack, I've created a postinstall script in package.json that runs yarn build.

This will failure though because the build relies on a few babel packages which are currently listed as dev dependencies.

Heroku does not install dev dependencies by default.

This should be able to be fixed locally either through Heroku configuration or by moving the dependencies locally outside of dev.

I'm filing this issue because it seems that it may be incorrect that these are listed as devDependencies. All other dependencies that are required for the build (including those from Nuxt) are listed as dependencies and work by default with the build packs decision to not install dev dependencies.

Should dev dependencies only be for packages that are used exclusively in development commands such as nuxt dev?

This question is available on Nuxt.js community (#c8)

Currently failing for the latest version of Nuxt.js ?

Hi @pi0 , I recently upgraded Nuxt.js to latest release which is rc2. For some reason, the run dev and build is failing with this template ? I was hoping if there's a quick solution to resolve problem apart from downgrading the nuxt version ?

Error:

(node:4906) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: __WEBPACK_IMPORTED_MODULE_2_nuxt___default.a is not a constructor
This question is available on Nuxt.js community (#c47)

Transpiling import/export routes on build

Is possible to use import/export features in the routes? I changed server.js to start like this:

import Nuxt from 'nuxt'
import express from 'express'

import api from './api'
.... 

And api/index.js to this:

import { Router } from 'express'
import users from './users'

const router = Router()

// Add USERS Routes
router.use(users)

export default router

It works during npm run dev, but not after npm run build and npm start, I'm getting this error:

function (exports, require, module, __filename, __dirname) { import Nuxt from 'nuxt';
                                                              ^^^^^^
SyntaxError: Unexpected token import
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
...

What should I change to enable this?

Thanks.

This question is available on Nuxt.js community (#c15)

scrollBehavior option gives syntax error

Hi,

When I try to add the following into my nuxt.config.js file:

router: { scrollBehavior: function (to, from, savedPosition) { return { x: 0, y: 0 } } }

I get the following error output in the console/terminal:

` error in ./.nuxt/router.js

Syntax Error: Unexpected token, expected ( (29:32)

27 |
28 |

29 | const scrollBehavior = function function(to, from, savedPosition) {
| ^
30 | return { x: 0, y: 0 };
31 | }
32 |

@ ./.nuxt/index.js 119:0-43
@ ./.nuxt/client.js
@ multi webpack-hot-middleware/client?reload=true ./.nuxt/client.js`

I am using nuxt version 1.0.0-alpha.4 and the latest version of express-template.

I have also tried adding the scrollToTop: true option into my .vue files but that doesn't seem to work either.

This question is available on Nuxt.js community (#c46)

ERROR: npm run dev on window

when i run npm run dev. Console screen display this error.
(node:23744) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: read ECONNRESET
How to fix it?

This question is available on Nuxt.js community (#c38)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.