Skip to content

Component works in development mode but not in production mode? #4065

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

Closed
praveenpuglia opened this issue May 27, 2019 · 3 comments
Closed

Component works in development mode but not in production mode? #4065

praveenpuglia opened this issue May 27, 2019 · 3 comments
Labels
needs team repro We acknowledged your report and will soon try to reproduce it

Comments

@praveenpuglia
Copy link

praveenpuglia commented May 27, 2019

Version

3.7.0

Reproduction link

http://vue-cli-test.surge.sh/

Environment info


  System:
    OS: macOS 10.14.5
    CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
  Binaries:
    Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
    Yarn: 1.16.0 - ~/.nvm/versions/node/v10.15.3/bin/yarn
    npm: 6.9.0 - ~/.nvm/versions/node/v10.15.3/bin/npm
  Browsers:
    Chrome: 74.0.3729.169
    Firefox: 66.0.5
    Safari: 12.1.1
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0
    @vue/babel-plugin-transform-vue-jsx:  1.0.0
    @vue/babel-preset-app:  3.7.0
    @vue/babel-preset-jsx:  1.0.0
    @vue/babel-sugar-functional-vue:  1.0.0
    @vue/babel-sugar-inject-h:  1.0.0
    @vue/babel-sugar-v-model:  1.0.0
    @vue/babel-sugar-v-on:  1.0.0
    @vue/cli-overlay:  3.7.0
    @vue/cli-plugin-babel: ^3.7.0 => 3.7.0
    @vue/cli-plugin-typescript: ^3.7.0 => 3.7.0
    @vue/cli-plugin-unit-jest: ^3.7.0 => 3.7.0
    @vue/cli-service: ^3.7.0 => 3.7.0
    @vue/cli-shared-utils:  3.7.0
    @vue/component-compiler-utils:  2.6.0
    @vue/preload-webpack-plugin:  1.1.0
    @vue/test-utils: 1.0.0-beta.29 => 1.0.0-beta.29
    @vue/web-component-wrapper:  1.2.0
    jest-serializer-vue:  2.0.2
    typescript: ^3.4.3 => 3.4.5
    vue: ^2.6.10 => 2.6.10
    vue-class-component: ^7.0.2 => 7.1.0
    vue-hot-reload-api:  2.3.3
    vue-jest:  3.0.4
    vue-loader:  15.7.0
    vue-property-decorator: ^8.1.0 => 8.1.1
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.5.21 => 2.6.10
    vue-template-es2015-compiler:  1.9.1
  npmGlobalPackages:
    @vue/cli: 3.7.0

Steps to reproduce

The surge.sh link is just a prod build deployed there of the same thing that's there on codesandbox.

The github repo url is this - https://github.com/praveenpuglia/vue-cli-test

The component library code(which i author and having this issue with) - https://github.com/vue-lego/blocks

What is expected?

I should see the same copy button in prod build too.

What is actually happening?

The component is not parsed / run as a vue component. Inspecting the DOM shows the markup that was used for the component's usage.

@LinusBorg LinusBorg added the needs team repro We acknowledged your report and will soon try to reproduce it label May 27, 2019
@haoqunjiang
Copy link
Member

Because when you use BCopy.name you are actually referring to the BCopy class's name property, which will be minified after building. Should use BCopy.options.name here.

@praveenpuglia
Copy link
Author

I tried changing that to BCopy.options.name but now I get type error saying options doesn't exist on type VueConstructor<Vue>.

Should I raise the typing issue to vue-class-component then?

I think BCopy should show up its type as VueConstructor<BCopy>. No?

@praveenpuglia
Copy link
Author

praveenpuglia commented May 28, 2019

BTW, changing it to BCopy.options.name actually did fix the issue.
Now, I need to get the typing thing fixed and everything should be good.

Thank you so much @sodatea :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs team repro We acknowledged your report and will soon try to reproduce it
Projects
None yet
Development

No branches or pull requests

3 participants