umijs / umi

A framework in react community ✨
https://umijs.org
MIT License
15.39k stars 2.65k forks source link

[Bug] externals react-router-dom 引入cdn后报 location undefined #6442

Closed codedart2018 closed 2 years ago

codedart2018 commented 3 years ago

externals react-router-dom 引入cdn后报 location undefined

  externals: prod
    ? {
      react: 'window.React',
      'react-dom': 'window.ReactDOM',
      // 'react-router-dom': 'ReactRouterDOM', //一排除它就报 location undefiend
    }
    : {},
  scripts: prod
    ? [
      'https://cdn.staticfile.org/react/17.0.2/umd/react.production.min.js',
      'https://cdn.staticfile.org/react-dom/17.0.2/umd/react-dom.production.min.js',
      // 'https://cdn.staticfile.org/react-router-dom/5.1.2/react-router-dom.min.js'
    ]
    : [],

Context

chemdemo commented 3 years ago

+1 @sorrycc 帮看下这个问题

JoyceLizhuo commented 3 years ago

+1遇到相同的问题

jing-wu commented 2 years ago

+1,关注

HaoChenxin commented 2 years ago

+1