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.

[Bug report] ie11 does not run components script.

See original GitHub issue
  • I confirm that this is an issue rather than a question.

Bug report

ie11 does not run components script.
After the build, the template comes up, but the script does not run at all.

Version

most current vuepress 1.0.0-alpha.42

Steps to reproduce

create .vuepress/componenets/Temp.vue

<template>
    <div>test</div>
</template>
<script>
    console.log('TEST SCRIPT');
    export default {
        data: function() {
            return {
                temp: 'ABCD'
            };
        }
    };
</script>

npm run build

What is expected?

Print ‘TEST SCRIPT’ text in IE11 CONSOLE.
experience like on Chrome.

What is actually happening?

Nothing.

Other relevant information

In the basic state without doing anything, ie11, an error about the arrow function basically occurs.

  • Your OS: Windows10
  • Node.js version: 9.11.2
  • Browser version: IE11
  • Is this a global or local install? local
  • Which package manager did you use for the install? npm
  • Does this issue occur when all plugins are disabled?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
yahao87commented, Apr 17, 2019

I was successful. Thanks @xxholly32

I modified my config.js file as follows:

module.exports = {
    host: '0.0.0.0',
    "port": 8080,
    "base": "/",
    "dest": "public",
    chainWebpack: (config, isServer) => {
        const jsRule = config.module.rule('js');
        jsRule.uses.delete('buble-loader');
        jsRule.use('babel-loader').loader('babel-loader')
            .options({
                presets: [
                    ["@babel/preset-env", {
                        useBuiltIns: "usage",
                        corejs: 3,
                    }]
                ],
                plugins: ["@babel/plugin-syntax-dynamic-import"],
            });
        const compileRule = config.module.rule('compile');
        compileRule
              .test(/\.js$/)
            .include
              .add(/@vuepress/)
              .add(/.temp/)
              .add(/docs/)
              .add(/packages/)
              .end()
            .use('babel-loader')
                .loader('babel-loader')
                .options({
                    presets: [
                        ["@babel/preset-env", {
                            useBuiltIns: "usage",
                            corejs: 3,
                        }]
                    ],
                    plugins: ["@babel/plugin-syntax-dynamic-import"],
            })
    }
}
2reactions
xxholly32commented, Apr 16, 2019

hi, @ulivz i found a way to work on ie11

vuepress commit

demo config commit

i think the problem is it cant babel vuepress in node_modules. and when i use useBuiltIns: 'entry' vuepress doesnt have config to add “@babel/polyfill

my company is more complicate. there it is

.rule('compile')
        .test(/\.js$/)
        .include
          .add(/@vuepress/)
          .add(/.temp/)
          .add(/docs/)
          .add(/packages/)
          .add(/src/)
          .add(/strip-ansi/)
          .add(/ansi-regex/)
          .end()

I would appreciate your reply

你好, @ulivz 我找到一个方法可以在ie11下跑

vuepress commit

demo config commit

我认为这里的问题是babel无法转义node_modules的vuepress,而且在用了 useBuiltIns: 'entry' vuepress并没有提供配置去全局加"@babel/polyfill"

我公司的配置更复杂,如下

.rule('compile')
        .test(/\.js$/)
        .include
          .add(/@vuepress/)
          .add(/.temp/)
          .add(/docs/)
          .add(/packages/)
          .add(/src/)
          .add(/strip-ansi/)
          .add(/ansi-regex/)
          .end()

如果得到您的回复我将非常感激

Read more comments on GitHub >

github_iconTop Results From Across the Web

IE 11 not running some javascript on some websites
IE 11 not running some javascript on some websites · 1. Have you installed all the updates for Internet Explorer 11 from Windows...
Read more >
IE11 no longer works when upgrading react-scripts from 3.4.3 ...
Describe the bug. I get the following error when launching IE11 after upgrading to react-scripts v4.0.1: Error: You must pass a component to...
Read more >
Reactjs class components not rendered but functions are ...
In React we write ES6 code that is newer version of java script, and some of older ... It's because IE 11 doesn't...
Read more >
Internet Explorer 11 will no longer be supported ... - SAP Blogs
To ensure a secure environment for running business-critical solutions, SAP recommends using the latest version of a modern and secure browser.
Read more >
Internet Explorer 11 (IE11) shows a blank page when logging ...
Resolving The Problem · 1. Turn off Compatibility mode (Settings > Compatibility View Settings > Untick everything). · 2. Settings > Internet Options...
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