Activities

Gedminas

Gedminas posted a new bug report

express-template •

bug nuxt 5.0.0 + it is not working. It is not getting the build

Version

5.0.0

Reproduction link

http://nuxt.com

Steps to reproduce

create empty project, try to run prod with express template

What is expected ?

it to work

What is actually happening?

it returns
Cannot GET /

Somehow it cannot get .nuxt files if the files are built prior. It is still working with dev environment

Additional comments?

was working with 4.5 nuxt

Gedminas

Gedminas posted a new question

express-template •

nuxt 5.0.0 + it is not working. It is not getting the build

it returns
Cannot GET /

Somehow it cannot get .nuxt files if the files are built prior. It is still working with dev environment

core01

core01 posted a new question

express-template •

TypeScript support

Hello, after the release v2.4.0 Nuxt has TypeScript support. Is there any example of implementation TypeScript Express and nuxt?
It is not clear to me how to use TypeScript with express-template, particularly on server side, because express-example uses nodemon and requires nuxt.config.js in server/index.js file.

Thank you!

gp15237125756

gp15237125756 posted a new question

express-template •

Can't resolve 'core-js/modules/es7.promise.finally'

When I execute yarn start after installing dependencies,this error emerge. Also the error file is client.js. I guess babel is mandatory here to resolve the file.So I changed the devDependencies in package.json as below .
"devDependencies": {
"babel-eslint": "^7.2.3",
"babel-core": "6.26.0",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "7.1.2",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-runtime": "6.23.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-preset-stage-2": "6.24.1",
"eslint": "^4.3.0",
"eslint-config-standard": "^10.2.1",
"eslint-loader": "^1.9.0",
"eslint-plugin-html": "^3.1.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.1.1",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1"
}
then the error disappeared.
My environment is windows 7 & node 8.11.1.

lanbau

lanbau posted a new question

express-template •

Demo link?

demo link is down

Jonham

Jonham posted a new question

express-template •

init project and run, get this error. "Unexpected token" on App (App.js)
error Error: Module parse failed: Unexpected token (93:4)
  You may need an appropriate loader to handle this file type.
  |
  |     },
  >     ...App
  |   };
  |   const next = ssrContext ? ssrContext.next : location => app.router.push(location); // Resolve route
  at Object../.nuxt/index.js (server-bundle.js:97:7)
  at __webpack_require__ (server-bundle.js:21:30)
  at Module../.nuxt/server.js (server-bundle.js:130:64)
  at __webpack_require__ (server-bundle.js:21:30)
  at Object.0 (server-bundle.js:392:18)
  at __webpack_require__ (server-bundle.js:21:30)
  at module.exports../.nuxt/index.js (server-bundle.js:85:18)
  at Object.<anonymous> (server-bundle.js:88:10)
  at evaluateModule (/Users/jonham/code/part/get-web-pc/node_modules/vue-server-renderer/build.js:8349:21)
  at /Users/jonham/code/part/get-web-pc/node_modules/vue-server-renderer/build.js:8407:18
  at new Promise (<anonymous>)
  at /Users/jonham/code/part/get-web-pc/node_modules/vue-server-renderer/build.js:8399:14
  at Object.renderToString (/Users/jonham/code/part/get-web-pc/node_modules/vue-server-renderer/build.js:8575:9)
  at Renderer.renderRoute (/Users/jonham/code/part/get-web-pc/node_modules/nuxt/dist/nuxt.js:2074:41)
  at Renderer.nuxtMiddleware (/Users/jonham/code/part/get-web-pc/node_modules/nuxt/dist/nuxt.js:1629:31)
  at call (/Users/jonham/code/part/get-web-pc/node_modules/connect/index.js:239:7)
  at next (/Users/jonham/code/part/get-web-pc/node_modules/connect/index.js:183:5)
  at next (/Users/jonham/code/part/get-web-pc/node_modules/connect/index.js:161:14)
  at SendStream.error (/Users/jonham/code/part/get-web-pc/node_modules/serve-static/index.js:121:7)
  at emitOne (events.js:116:13)
  at SendStream.emit (events.js:211:7)
  at SendStream.error (/Users/jonham/code/part/get-web-pc/node_modules/serve-static/node_modules/send/index.js:270:17)
fewiki

fewiki posted a new question

express-template •

Not work on [email protected], it works on nuxt-edge

After update to v2.2.0, the example https://nuxtjs.org/api/nuxt-render/ doesnot work on express
But it works ok on nuxt-edge . More info: https://cmty.app/nuxt/nuxt.js/issues/c7985

fewiki

fewiki posted a new question

express-template •

Not work on [email protected], it work on nuxt-edge

After update to v2.2.0, the example https://nuxtjs.org/api/nuxt-render/ doesnot work on express
But it works ok on nuxt-edge . More info: https://cmty.app/nuxt/nuxt.js/issues/c7985

thaycacac

thaycacac posted a new question

express-template •

How to Deploys to netlify?

I try to deploy my website to netlify but not successful. It seems impossible to execute the command
npm run generate

TheGitPanda

TheGitPanda posted a new question

express-template •

Readme Installation no longer successful

Since Webpack 4, there seems to be an issue with this project. I've been following the documentation on the readme.

  • Vue-CLI 2.1 is installed

When running npm run dev an error about eslint-loader is showing. It seems nuxt is still installing Webpack 4 and leads me to believe its throwing all the dependencies into version warns and out of whack.

Further to tweaking to try and fix myself, Ive attempted:

  • To revert my eslint-loader package to @1.9.0
  • To revert my webpack to @3.12.0

But pussyfooting around with more errors. Theoretically this should just work, right?

nugrahawahyu

nugrahawahyu posted a new question

express-template •

TypeError: Cannot read property 'eslint' of undefined

Nothing to preview

horihiro

horihiro posted a new question

express-template •

Running on Azure WebApps

Hi,

I tried to run this template on Azure Web Apps.
But it was failed.

I found that the issue is caused by the Web Apps architecture (e.g. using iisnode and Named Pipe, and restriction of connection to 'localhost' ).

Especially, named pipe (and unix pipe) is not supported by latest(1.4.2) of nuxt.js.
It will be supported from this commit of 2.x.

Do you have any plans to change version of nuxt.js?

F.Y.I.
I published two repositories.
horihiro/nuxt.js is forked from v1.4.2 of nuxt.js to add support of named pipe.
horihiro/nuxt-express-azure-webapps is generared by this template, and is added some commits to run on Azure WebApps.

JkmAS

JkmAS posted a new question

express-template •

Is it possible to use aliases ~ in express?

Hi,
I am using nuxt-edge with express server via nuxt.config.js serverMiddleware and I want to use aliases (~, ~~) in imports in the same way as on the frontend (e. g. in vue templates).

Is it even possible to use them? Because in this repo they are not used https://github.com/nuxt-community/express-template/blob/master/template/api/index.js#L7.

Thanks


If I use alias, the nuxt throws an error Cannot find module '~/router/router'.

Works: import router from './router/router';
Doesn't work import router from '~/router/router';

express.js index file

'use strict';

import express from 'express';
import bodyParser from 'body-parser';

import router from '~/router/router';
import log from '~/helpers/logger';

const app = express();

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());

app.use(router);

// catch pm2 shutdown signal
process.on('SIGINT', () => {
  log.info('Service graceful shutdown');
});

export default {
  path: '/api',
  handler: app
};

nuxt.config.js

export default {
  rootDir: __dirname, 
  router: {
    middleware: 'lang'
  },
  // server api
  serverMiddleware: ['~/server/index.js'],
  axios: {
    browserBaseURL: '/'
  },
  modules: [
    '@nuxtjs/axios',
    '@nuxtjs/pwa'  
    ]
  ]
};
d3l3rium1986

d3l3rium1986 posted a new question

express-template •

ExpressJS Changes - Entry Point ??

Just a quick question hopefully. Since the ExpressJS changes and removal of Backpack, there is no longer a Build/main.js to point to. Most of our apps end up with going through Plesk using Passenger which require an entry point which I can seem to work out since the changes. Hope that makes sense, cheers

foadyousefi

foadyousefi posted a new question

express-template •

Nuxt don't have access to req from server

I'm using this template for a while and every thing was OK. The setup is like this:
for authentication on the server, I'm using passport and express-session.

In the nuxtServerInit, I was trying to check if user is authenticated:
if (req.isAuthenticated())

After updated the app to use the new approach of setting server as serverMiddleware, now the nuxt app don't have access to req.session or req.isAuthenticated(). Basically it don't have access to server req object and for checking if user authenticated, I've created an api endpoint and in the nuxtServerInit, sending an api request and getting user object.

Other stuff like accessing authenticated router endpoints on the server is working perfectly.

After lots of googling, was not able to find any solutions. Not sure if this is issue or does it suppose to be like that.

Note: The README is still not updated for the latest changes. For example it still mentions backpack have been used, but it is removed.

jingxinxin

jingxinxin posted a new question

express-template •

Why can't [HMR] to modify the files in the api folder path but other files can work?

What needs to be configured?

Can you give an example?

Please

thearabbit

thearabbit posted a new question

express-template •

Could example to use `Mongodb` in this?

Could example to use Mongodb in this?

erickarbe

erickarbe posted a new question

express-template •

Ignores nuxt.config.js

When using this template (and this code below in the API folder, does it completely ignore the nuxt.config.js file? I am running express with Nuxt and it seems this is the case. The config file is completely ignored.

// We instantiate Nuxt.js with the options const isProd = process.env.NODE_ENV === 'production' const nuxt = new Nuxt({ dev: !isProd }) // No build in production if (!isProd) { const builder = new Builder(nuxt) builder.build() } app.use(nuxt.render) app.listen(3000) console.log('Server is listening on http://localhost:3000')

sharh

sharh posted a new question

express-template •

Jmeter benchmark is very slow

I have used nuxt.js in my project, use nginx as the proxy, but there is a problem,when the amount of visits is very large, 504 errors often occur.

Then I have do a benchmark of the nuxt.js project, here are the report:

# init the project with express-template, the lastest.
vue init nuxt-community/express-template express-nuxt

When the project up, It looks like this:

1.png

Jmeter params:

<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="4.0" jmeter="4.0 r1823414">
  <hashTree>
    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
      <stringProp name="TestPlan.comments"></stringProp>
      <boolProp name="TestPlan.functional_mode">false</boolProp>
      <boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
      <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
      <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
        <collectionProp name="Arguments.arguments"/>
      </elementProp>
      <stringProp name="TestPlan.user_define_classpath"></stringProp>
    </TestPlan>
    <hashTree>
      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
          <boolProp name="LoopController.continue_forever">false</boolProp>
          <intProp name="LoopController.loops">-1</intProp>
        </elementProp>
        <stringProp name="ThreadGroup.num_threads">200</stringProp>
        <stringProp name="ThreadGroup.ramp_time">1</stringProp>
        <boolProp name="ThreadGroup.scheduler">false</boolProp>
        <stringProp name="ThreadGroup.duration"></stringProp>
        <stringProp name="ThreadGroup.delay"></stringProp>
      </ThreadGroup>
      <hashTree>
        <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Request" enabled="true">
          <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
            <collectionProp name="Arguments.arguments"/>
          </elementProp>
          <stringProp name="HTTPSampler.domain">10.9.34.121</stringProp>
          <stringProp name="HTTPSampler.port">3000</stringProp>
          <stringProp name="HTTPSampler.protocol">http</stringProp>
          <stringProp name="HTTPSampler.contentEncoding"></stringProp>
          <stringProp name="HTTPSampler.path">/</stringProp>
          <stringProp name="HTTPSampler.method">GET</stringProp>
          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
          <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
          <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
          <stringProp name="HTTPSampler.connect_timeout"></stringProp>
          <stringProp name="HTTPSampler.response_timeout"></stringProp>
        </HTTPSamplerProxy>
        <hashTree>
          <ResultCollector guiclass="StatGraphVisualizer" testclass="ResultCollector" testname="Aggregate Graph" enabled="true">
            <boolProp name="ResultCollector.error_logging">false</boolProp>
            <objProp>
              <name>saveConfig</name>
              <value class="SampleSaveConfiguration">
                <time>true</time>
                <latency>true</latency>
                <timestamp>true</timestamp>
                <success>true</success>
                <label>true</label>
                <code>true</code>
                <message>true</message>
                <threadName>true</threadName>
                <dataType>true</dataType>
                <encoding>false</encoding>
                <assertions>true</assertions>
                <subresults>true</subresults>
                <responseData>false</responseData>
                <samplerData>false</samplerData>
                <xml>false</xml>
                <fieldNames>true</fieldNames>
                <responseHeaders>false</responseHeaders>
                <requestHeaders>false</requestHeaders>
                <responseDataOnError>false</responseDataOnError>
                <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
                <assertionsResultsToSave>0</assertionsResultsToSave>
                <bytes>true</bytes>
                <sentBytes>true</sentBytes>
                <threadCounts>true</threadCounts>
                <idleTime>true</idleTime>
                <connectTime>true</connectTime>
              </value>
            </objProp>
            <stringProp name="filename"></stringProp>
          </ResultCollector>
          <hashTree/>
        </hashTree>
      </hashTree>
    </hashTree>
  </hashTree>
</jmeterTestPlan>

The result:

2.png

When i use vue-ssr like vue-hackernews-2.0, the same Jmeter params, but the result is very different:

3.png

Then I try the express-generator to create a project, express -e, here is the result:

4.png

The result is that nuxt.js based vue-ssr is very slow, the Jmeter Throughput is just 320/sec.

Is there something wrong with my benchmark or something what let nuxt.js slow? Need some help!!!

Thanks~

BroTrue

BroTrue posted a new question

express-template •

No server folder

Hello,
I try to use this template but, while instalition i cant sind folder 'server'. What is the reason ?