question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

runtimeCompiler causes rewriting of some dependencies in chunk-vendors to use ES6 syntax

See original GitHub issue

Version

3.9.0

Environment info

System:
    OS: macOS 10.14
  Binaries:
    Node: 10.15.2 - /opt/local/bin/node
    Yarn: 1.16.0 - /opt/local/bin/yarn
    npm: 6.9.2 - /opt/local/bin/npm
  Browsers:
  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.9.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.9.0 
    @vue/cli-plugin-babel: ^3.9.0 => 3.9.0 
    @vue/cli-plugin-eslint: ^3.9.0 => 3.9.1 
    @vue/cli-plugin-unit-mocha: ^3.9.0 => 3.9.0 
    @vue/cli-service: ^3.9.0 => 3.9.0 
    @vue/cli-shared-utils:  3.9.0 
    @vue/component-compiler-utils:  2.6.0 
    @vue/eslint-config-prettier: ^4.0.1 => 4.0.1 
    @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 
    eslint-plugin-vue: ^5.0.0 => 5.2.3 (4.7.1)
    vue: ^2.6.10 => 2.6.10 
    vue-eslint-parser:  2.0.3 (5.0.0)
    vue-hot-reload-api:  2.3.3 
    vue-loader:  15.7.0 
    vue-router: ^3.0.3 => 3.0.7 
    vue-style-loader:  4.1.2 
    vue-template-compiler: ^2.6.10 => 2.6.10 
    vue-template-es2015-compiler:  1.9.1 
    vuex: ^3.0.1 => 3.1.1 
  npmGlobalPackages:
    @vue/cli: 3.8.4

Steps to reproduce

Create a ‘hello-world’ app with vue-cli (all defaults). Add a vue.config.js file. Build. Observe that the ‘chunk-vendors’ file contains no arrow functions. Set ’ runtimeCompiler: true’ in the vue.config.js file. Build. Observe that one of the dependencies in the ‘chunk-vendors’ file contains arrow functions.

What is expected?

The ‘chunk-vendors’ file contains no arrow functions.

What is actually happening?

The ‘chunk-vendors’ file contains arrow functions.


Initially, I saw this because the project wouldn’t run in IE. I thought that this was because of the Babel/node_modules defaults, so I set about trying to work with ‘transpileDependencies’ settings, which didn’t work. I tried eliminating dependencies, to explicitly set the dependency file path, all with no success, until I went back to testing with the ‘hello-world’ app.

The effect in a ‘real-world’ project is unpredictable but consistent in that it does happen every time. If I remove a dependency, then which dependency is rewritten changes - generally between one and two, although it does seem to like rewriting Bootstrap when available. After a couple of days at this I realised that it was the runtimeCompiler setting that was triggering it.

I don’t explicitly need the runtimeCompiler, I’m not sure why I enabled this, but it seems to me that this is a bug and I have seen that others have encountered this also.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sodateacommented, Jul 8, 2019

Do you have an actual reproduction repo? Because I can’t find any arrow functions after following your steps to reproduce.

0reactions
vue-botcommented, Jul 29, 2019

Hey again! 😸️

It’s been 20 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. 🤖 Please feel free to reopen this issue or create a new one if you need anything else.

Thanks again for being part of the Vue community! 💚️

Read more comments on GitHub >

github_iconTop Results From Across the Web

In a Vue CLI app, how can I find which dependency causes a ...
This article describes how to split dependencies into chunks that can then be addressed individually, rather than getting a syntax error for the ......
Read more >
Configuration Reference | Vue CLI
Global CLI Config #. Some global configurations for @vue/cli , such as your preferred package manager and your locally saved presets, are stored ......
Read more >
The road to native ES6 SPAs - Sean Blanchfield
In this post I go on a major rant against the Javascript/Babel/Webpack/Node development stack, and then talk about the problems I'm facing in...
Read more >
Features | Vite
Rewrite the imports to valid URLs like /node_modules/.vite/deps/my-dep.js?v=f3sf2ebd so that the browser can import them properly. Dependencies are Strongly ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found