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

ie11 error when using razzle+ts+react-loadable (help needed) #716

Closed
begoat opened this issue Jul 31, 2018 · 2 comments
Closed

ie11 error when using razzle+ts+react-loadable (help needed) #716

begoat opened this issue Jul 31, 2018 · 2 comments

Comments

@begoat
Copy link

begoat commented Jul 31, 2018

I integrate react-loadable and typescript with razzle as the example does.
But when i test it in IE 11. unexpected error occurred.

  1. bundle.61eb9c53.js Syntax error
    and this line leads to syntax error var ve=class extends r.Component
    It seems it didn't correctly transpile to es5 which IE 11 runs

  2. the other error is Object doesn't support property or method 'main'

screen shot 2018-07-31 at 10 07 02 pm

Here is the razzle.config.js

const { ReactLoadablePlugin } = require('react-loadable/webpack');

module.exports = {
  plugins: ['typescript'],
  modify: (config, { target }) => {
    if (target === 'web') {
      return {
        ...config,
        plugins: [
          ...config.plugins,
          new ReactLoadablePlugin({
            filename: './build/react-loadable.json',
          }),
        ],
      };
    }

    return config;
  },
};

Am i wrong?

I also tried adding "es2015" in .babelrc but it seems doesn't work,
could you give me a hand? Thanks in advance

Here is the mininal-demo-project

@begoat
Copy link
Author

begoat commented Aug 12, 2018

could anyone give some cules

@begoat
Copy link
Author

begoat commented Aug 13, 2018

In typescript plugin options: set useBabel: true, solving this problem.

At the beginning, i thought the error of webpack config cause this problem, but according to #437, it is right.

@begoat begoat closed this as completed Aug 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant