Get the App
SLTechnology News&Howtos  ›  Development  › 

What if there is a page blank screen in the development of vue framework?

Shulou Source: shulou.com Published: 2022-06-03 09:57:31 11月15日 Update

Editor to share with you about the vue framework development page white screen how to do, I believe that most people do not understand, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to understand it!

What's wrong with the blank screen of the web page?

1.npmrunbuild Packaging Page is blank

We will find that there is a path error in the js and css files referenced in the page head, which is modified as follows:

Solution location: config/index.js file: change assetsPublicPath:'/' to assetsPublicPath:'./'

Build: {

AssetsPublicPath:'./'

}

Unable to open web page under Safari of 2.iOS

The version of webpack-dev-server > = 2.8.0 cannot open the web page under iOSSafari, and the effect is white screen.

Console error: Can'tfindvariable:SockJS should be the BUG of Safari. For example, the following code will throw

Erroreval ("consta=function () {}; functionb () {a ();}; b ();")

The solution to the blank screen of web pages

1. Use the old version:

two。 Other methods

Yarnaddbabel-plugin-transform-es2015-block-scoping-D

Modify webpack related configuration

{

Test:/\ .js $/

Loader:'babel-loader'

Include: [

...

/ node_modules\ / webpack-dev-server/

]

}

3. Upgrade vue2+ part of the mobile phone access page blank

Messages that cannot be loaded into the routing template may appear after npmrundev.

Solution location: config/index.js file: change devtool:'#eval-source-map' to devtool:'inline-source-map'

Dev: {

Devtool:'inline-source-map'

}

4. Upgrade vue2+IP access page blank

By default, it can only be accessed through localhost or 127.0.0.1, and it will be inaccessible if you use the native Ip address.

Solution location: config/index.js file: configure "host" in config/index.js to "0.0.0.0", or set it to the IP address of your computer:

Dev: {

Host:'192.168.10.122'

The above is all the contents of the article "what to do when the page goes white in vue framework development?" Thank you for your reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Page file web page location blank article what to do framework development content address situation method version upgrade configuration not much code information most Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Microsoft OPPO Reno MySQL Huawei