Static GitHub Issues

[2916] [Bug Report] Nuxt的spa模式下, style中使用background的url语句, dev状态可以正常访问, build之后访问报错.

prev: nuxt.generate()
next: get the user's IP in the first request
<!-- generated by https://eleme-issue.surge.sh DO NOT REMOVE -->

Nuxt version

1.3.0

Vue version

2.5.13

OS/Browsers version

64.0.3282.167

Reproduction Link

https://github.com/xachary/nuxt-spa-style-url-build-error

Steps to reproduce

install dependencies

$ npm install

serve with hot reload at localhost:3000

$ npm run dev-spa

build for production and launch server at localhost:3001

$ npm run build-spa $ npm run start-spa

What is Expected?

'dev version' and 'build version' is both ok.

What is actually happening?

You can see 'build version' showing error message. image

But if you delete one of 'background-image: url('../assets/img.png');' in '/pages/index.vue', build again, then you can see 'build version' is ok again. image

<!-- generated by https://eleme-issue.surge.sh DO NOT REMOVE --><!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2531">#c2531</a>)</em></sub></div>