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

Modern mode still doesn't work on typescript #2609

Closed
archseer opened this issue Sep 25, 2018 · 7 comments
Closed

Modern mode still doesn't work on typescript #2609

archseer opened this issue Sep 25, 2018 · 7 comments
Labels
needs team repro We acknowledged your report and will soon try to reproduce it scope: cli-service build scope: typescript

Comments

@archseer
Copy link

Version

3.0.4

Node and OS info

latest

Steps to reproduce

yarn build --modern

What is expected?

The -legacy and regular bundle should be different sizes, and the regular one should contain arrow functions.

What is actually happening?

Files are almost identical apart from the sourcemap.

-rw-r--r--   1 speed  staff   394K Sep 19 18:49 app-legacy.49d50903.js
-rw-r--r--   1 speed  staff   394K Sep 19 18:50 app.b75421a2.js

I also can't find the arrow function used anywhere in the modern bundle:

$ rg "=>" app.b75421a2.js
(empty)

d6d2af5 took a stab at fixing this issue, but it seems to not be resolved.

@LinusBorg LinusBorg added the needs reproduction This issue is missing a minimal runnable reproduction, provided by the author label Sep 29, 2018
@LinusBorg
Copy link
Member

Can't reproduce:

bildschirmfoto 2018-09-29 um 12 08 59

Checked bundle content, modern one contains sync keyword, legacy one doesn't.

@archseer
Copy link
Author

Alright, trying to build a minimal repro case

@archseer
Copy link
Author

@LinusBorg Ok so I went and generated a new project with this preset:

{
  "packageManager": "yarn",
  "presets": {
    "ts": {
      "useConfigFiles": true,
      "plugins": {
        "@vue/cli-plugin-babel": {},
        "@vue/cli-plugin-typescript": {
          "classComponent": true,
          "useTsWithBabel": true
        },
        "@vue/cli-plugin-pwa": {},
        "@vue/cli-plugin-eslint": {
          "config": "airbnb",
          "lintOn": [
            "save"
          ]
        },
        "@vue/cli-plugin-unit-jest": {},
        "@vue/cli-plugin-e2e-nightwatch": {}
      },
      "router": true
    }
  },
  "useTaobaoRegistry": false
}

Then I copied my package.json and removed packages one by one.

Adding vuepress as a dependency to package.json makes modern mode stop working. (I followed the guide here to add it to an existing project: https://vuepress.vuejs.org/guide/getting-started.html#inside-an-existing-project)

I need it included in package.json because I'm sharing some of the components/dependencies with the main app, but I don't want vuepress to mess with my regular vue build.

@LinusBorg
Copy link
Member

Great, can you put the project that you tested it with up on github? Then we can be sure we are doing the same thing.

@archseer
Copy link
Author

archseer commented Oct 2, 2018

Here: https://github.com/archSeer/tsmodern

yarn build --modern

Search for arrowTest inside app.*.js (not .map)

[{key:"arrowTest",value:function(){return function(){}}}]

Now remove vuepress from package.json, run yarn install, then yarn build --modern and it will work correctly again.

@LinusBorg LinusBorg added needs team repro We acknowledged your report and will soon try to reproduce it and removed needs reproduction This issue is missing a minimal runnable reproduction, provided by the author labels Oct 2, 2018
@archseer
Copy link
Author

archseer commented Oct 5, 2018

I think the typescript tag can be removed since it's a vuepress issue apparently, also maybe I should re-open the issue on the vuepress repo?

@LinusBorg
Copy link
Member

Yes please. Close it here and re-open in their repository.

Thanks!

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 scope: cli-service build scope: typescript
Projects
None yet
Development

No branches or pull requests

2 participants