Nuxt.js: 12.13.0 update: Running `nuxt build --spa` overwrites target defined in config

Created on 22 Jun 2020  路  2Comments  路  Source: nuxt/nuxt.js

Version

v2.13.0

Reproduction link

https://codesandbox.io/s/hungry-tree-0z31q?file=/package.json

Steps to reproduce

Running nuxt build --spa, with target set to _server_ in your nuxt config has the target overloaded (due to the --spa flag). This is an issue because process.static is being used to determine if nuxt build && nuxt export was used or not. This is causing async data & asyc fetch calls to be skipped over with the check: if ((process.static && !process.client) || !process.static). If there is another way to determine whether a payload from nuxt export is expected please advise.

What is expected ?

Nuxt build will respect the target defined in the nuxt.config

What is actually happening?

Nuxt is setting target to 'static' if the --spa flag is used on nuxt build

Additional comments?

Again, if there is an alternative way to determine whether a payload from nuxt export is expected, please let me know.

Thanks.

This bug report is available on Nuxt community (#c10830)
bug-report stale

Most helpful comment

Hi @lcanizzo

Actually it was to respect the actually Nuxt v2.12 behaviour which was setting process.static when doing nuxt build --spa.

You want to run nuxt build --spa --no-generate to keep the current target (this will be simplified for Nuxt 3)

All 2 comments

Hi @lcanizzo

Actually it was to respect the actually Nuxt v2.12 behaviour which was setting process.static when doing nuxt build --spa.

You want to run nuxt build --spa --no-generate to keep the current target (this will be simplified for Nuxt 3)

Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of nuxt-edge
  2. Comment the steps to reproduce it

Issues that are labeled as pending will not be automatically marked as stale.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shyamchandranmec picture shyamchandranmec  路  3Comments

bimohxh picture bimohxh  路  3Comments

vadimsg picture vadimsg  路  3Comments

mikekidder picture mikekidder  路  3Comments

nassimbenkirane picture nassimbenkirane  路  3Comments