Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message for mismatched vue, vue-template-compiler #209

Closed
fastfedora opened this issue Jan 25, 2019 · 5 comments
Closed

Improve error message for mismatched vue, vue-template-compiler #209

fastfedora opened this issue Jan 25, 2019 · 5 comments

Comments

@fastfedora
Copy link

When the version of the vue-template-compiler does not match the version of vue, the following error is thrown (code):

node_modules/fork-ts-checker-webpack-plugin/lib/VueProgram.js:183
            throw new Error('When you use `vue` option, make sure to install `vue-template-compiler`.');
            ^
Error: When you use `vue` option, make sure to install `vue-template-compiler`.

In this case vue-template-compiler is already installed; it's just that there is a version number mismatch. It would be helpful if the following text was added:

If vue-template-compiler is already installed as a dependency, ensure it has the same version number as the vue dependency.

Alternatively, printing the underlying error thrown from vue-template-compiler would help make the root cause of the error clearer.

@xinbenlv
Copy link

xinbenlv commented May 3, 2019

+10000000000

@xinbenlv
Copy link

xinbenlv commented May 3, 2019

@johnnyreilly
Copy link
Member

Sounds good. Would you like to submit a PR?

@fastfedora
Copy link
Author

I no longer am on the project I was using Vue for, so have no easy way to test the code for a PR. But a decent fix would be to change lines 313-317 from:

    } catch (err) {
      throw new Error(
        'When you use `vue` option, make sure to install `vue-template-compiler`.'
      );
    }

To:

    } catch (err) {
      throw new Error(
        `Could not initialize 'vue-template-compiler'. When you use 'vue' option, make 
sure to install 'vue-template-compiler' and that the version matches that of 'vue'. 
Error details: ${err.message}`;
      );
    }

@piotr-oles
Copy link
Collaborator

@fastfedora , @xinbenlv
Please try fork-ts-checker-webpack-plugin@alpha - I've published a new version which should resolve this issue 🚀
I will close this issue to clean-up the backlog :)

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

No branches or pull requests

4 participants