Skip to content

Compilation errors are hidden when using VueSSRServerPlugin #5553

Closed
@amoe

Description

@amoe

Version

2.3.0

Reproduction link

https://github.com/amoe/vue-ssr-compile-error-demo

Steps to reproduce

  • npm install
  • npm run build

What is expected?

Something related to the real error that caused the compilation failure. In this case:

Entry module not found: Error: Can't resolve './nonexistent.js' in '/home/amoe/werk/vue-bug'
resolve './nonexistent.js' in '/home/amoe/werk/vue-bug'
  using description file: /home/amoe/werk/vue-bug/package.json (relative path: .)
  after using description file: /home/amoe/werk/vue-bug/package.json (relative path: .)
    using description file: /home/amoe/werk/vue-bug/package.json (relative path: ./nonexistent.js)
      as directory
        /home/amoe/werk/vue-bug/nonexistent.js doesn't exist
      no extension
        /home/amoe/werk/vue-bug/nonexistent.js doesn't exist
      .js
        /home/amoe/werk/vue-bug/nonexistent.js.js doesn't exist
      .json
        /home/amoe/werk/vue-bug/nonexistent.js.json doesn't exist

What is actually happening?

TypeError: Cannot read property 'assets' of undefined
    at Compiler.<anonymous> (/home/amoe/werk/vue-bug/node_modules/vue-server-renderer/server-plugin.js:50:51)
    at Compiler.applyPluginsAsyncSeries (/home/amoe/werk/vue-bug/node_modules/tapable/lib/Tapable.js:142:13)
    at Compiler.emitAssets (/home/amoe/werk/vue-bug/node_modules/webpack/lib/Compiler.js:303:7)
    at onCompiled (/home/amoe/werk/vue-bug/node_modules/webpack/lib/Compiler.js:242:11)

(rest of stack trace trimmed)


The problem is that the VueSSRServerPlugin hides any other errors that may exist with the webpack configuration. To clarify, it's not just a nonexistent entry file that this problem hides -- that wouldn't be as bad. It affects and hides other errors that may exist in the configuration, meaning you have to disable VueSSRServerPlugin to debug your Webpack configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions