https://codesandbox.io/s/hungry-tree-0z31q?file=/package.json
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.
Nuxt build will respect the target defined in the nuxt.config
Nuxt is setting target to 'static' if the --spa flag is used on nuxt build
Again, if there is an alternative way to determine whether a payload from nuxt export is expected, please let me know.
Thanks.
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:
Issues that are labeled as pending will not be automatically marked as stale.
Most helpful comment
Hi @lcanizzo
Actually it was to respect the actually Nuxt v2.12 behaviour which was setting
process.staticwhen doingnuxt build --spa.You want to run
nuxt build --spa --no-generateto keep the current target (this will be simplified for Nuxt 3)