Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Build Web npm run build:web #626

Open
ViniciusAugusto opened this issue Jun 1, 2018 · 7 comments
Open

Build Web npm run build:web #626

ViniciusAugusto opened this issue Jun 1, 2018 · 7 comments

Comments

@ViniciusAugusto
Copy link

After running npm run build:web and running on an http server with http-server the folder dist / web I have the following error in the console and the page is blank

captura de tela 2018-06-01 as 14 56 53

  • Node version: v8.6.0
  • NPM version: 5.6.0
  • Mac OS: 10.13.4
@ViniciusAugusto ViniciusAugusto changed the title Build Web npm run build:web Build Web npm run build:web Jun 1, 2018
@CS-Tao
Copy link

CS-Tao commented Jul 2, 2018

Same here !

After running yarn build:web I got this error first :

image

I changed .electron-vue/webpack.web.config.js in my local repository after refer to webpack-contrib/css-loader#447 :

let webConfig = {
  devtool: '#cheap-module-eval-source-map',
  entry: {
    web: path.join(__dirname, '../src/renderer/main.js')
  },
+ node: {
+   fs: 'empty'
+ },
  module: {
    rules: [...]
  }
...
}

After that yarn build:web built successfully, but I got this error in Chrome :

o.existsSync is not a function. ('o' should be 'fs' ?)

image

OS : Windows 10 or Ubuntu 18.04
Node : v8.11.2
NPM : 5.6.0
Others : package.json

Can anyone help me ? Many thanks !

@CS-Tao
Copy link

CS-Tao commented Jul 6, 2018

I fixed it by catching the exception of require('electron').shell.openExternal(url).

The changes in my codes as follows:

src/renderer/main.js:

image

src/renderer/components/GithubCorner/index.vue:

image

@XanderLuciano
Copy link
Collaborator

XanderLuciano commented Sep 7, 2018

Hm, on the latest version of this template I'm not running into the same error, but after looking at @CS-Tao 's suggestion we might still want to add that to the template.

I tested on Windows 10 though, and with newer versions of the template and NPM (6.4.1). If someone could confirm this is still an issue or if the fix above should be added to the template, that would be appreciated!

@50l3r
Copy link

50l3r commented Jan 20, 2019

I have the same error:

adding in webpack.web.config.js:

node: { fs: 'empty' },

I recieve this error visiting index.html

Uncaught TypeError: n.existsSync is not a function
at Object. (web.js:14)
at Object. (web.js:14)
at c (web.js:1)
at r (web.js:1)
at Object. (web.js:14)
at c (web.js:1)
at r (web.js:1)
at Object. (web.js:14)
at c (web.js:1)
at r (web.js:1)

electron-vue: latest
s.o: windows 10 x64
node: 10.13.0
npm: 6.4.1

@jxzzz
Copy link

jxzzz commented Jun 6, 2019

I also have the same problem ..

@hanshou101
Copy link

The #857 says #751 has solved this problem.

after the exclusion of [electron-vuex] in the build: web environment, $ yarn run build: web can be packaged normally, and the index.html file can run normally without error.

@Letmeouted
Copy link

I have the same problem .how to solved this problem?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants