[vue-server-renderer] Bug failing when using a reference of process - related to SSRClientWebpackPlugin

tkjaergaard:
+1
I'm experiencing the same issue TypeError: Cannot read property 'replace' of undefined.
Downgrading to vue@2.5.17, vue-server-renderer@2.5.17 and vue-template-compiler@2.5.17 made my application run again.
2.5.18-2.5.21 make my application break with the TypeError:

TypeError: Cannot read property 'replace' of undefined
    at normalizeFile (.../node_modules/vue-server-renderer/build.js:8176:27)


Zacaria:
Same error here since five days, this morning magically disappeared 🤔

chentianyuan:

same error here


fix it, maybe will should put VueSSRClientPlugin in a right place

vuejs:
I had this error too when building my client webpack config. It turns out that I forgot to delete VueSSRServerPlugin() and had both the server and client plugin. As soon as I removed the server plugin from the client config it works.
I am not sure if it's related but someone else might have the same issue.

sebastianks:
For me, the error was caused by a malformed vue-ssr-client-manifest.json : in the modules section, some modules were mapped to indexes -1. As a result, at runtime, the vue-server-renderer was unable to load the file.
To fix it, I just enabled the source maps for css files. In vue.config.js, add to your client config :
```javascript css: { sourceMap: true, }, ``` Tested with version 2.6.9.
I hope this will help.

laure-at-irun:
@laure-at-irun yep! that was my issue as well

AlexandreBonaventure:
@laure-at-irun This fixed the issue for me too. But why!?

OliverJEvans:
The vue client plugin receives from webpack compilation stats a list of files that includes css maps, even when css maps are not emitted. The list is provided by webpack though stats.chunks.files. The stats.assets doesn't contain the css map files.
However, I am not sure why webpack is doing this.
Anyway, the client plugin is not robust to webpack inconsistent data.

laure-at-irun:
#9488 (comment)

lovetingyuan:

The vue client plugin receives from webpack compilation stats a list of files that includes css maps, even when css maps are not emitted. The list is provided by webpack though stats.chunks.files. The stats.assets doesn't contain the css map files.

However, I am not sure why webpack is doing this.

Anyway, the client plugin is not robust to webpack inconsistent data.

Maybe souceMap in chunks is set by option: devtool.
原文地址:https://github.com/vuejs/vue/issues?utf8=%E2%9C%93&q=TypeError&page=2