Skip to content

Using the CDN address to use ant-design-vue in ESM mode does not work correctly #6954

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

Closed
1 task done
codelzb opened this issue Sep 17, 2023 · 4 comments
Closed
1 task done
Labels

Comments

@codelzb
Copy link

codelzb commented Sep 17, 2023

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.0.1

Environment

any

Reproduction link

https://jsrun.net/NGJKp

Steps to reproduce

执行下面的代码可重现

What is expected?

正常运行

What is actually happening?

出现错误Uncaught TypeError: Cannot read properties of undefined (reading 'renderEmpty')

@codelzb
Copy link
Author

codelzb commented Sep 17, 2023

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>test</title>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.global.min.js"></script>
  <script src="https://unpkg.com/dayjs/dayjs.min.js"></script>
  <script src="https://unpkg.com/dayjs/plugin/customParseFormat.js"></script>
  <script src="https://unpkg.com/dayjs/plugin/weekday.js"></script>
  <script src="https://unpkg.com/dayjs/plugin/localeData.js"></script>
  <script src="https://unpkg.com/dayjs/plugin/weekOfYear.js"></script>
  <script src="https://unpkg.com/dayjs/plugin/weekYear.js"></script>
  <script src="https://unpkg.com/dayjs/plugin/advancedFormat.js"></script>
  <script src="https://unpkg.com/dayjs/plugin/quarterOfYear.js"></script>
  <!-- <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/antd.min.js"></script> -->
  <script type="importmap">
  {
    "imports": {
      "ant-design-vue": "https://cdn.jsdelivr.net/npm/[email protected]/+esm"
    }
  }
</script>
</head>

<body>
  <div id="app">{{ message }}
    <a-button type="primary">Primary Button</a-button>
  </div>

</body>
<script type="module">
  import antd from "ant-design-vue";
  const app = Vue.createApp({
    data() {
      return {
        message: 'Hello Vue.js!'
      }
    }
  })
  app.use(antd)
  app.mount('#app');

</script>

</html>

@codelzb
Copy link
Author

codelzb commented Sep 20, 2023

我将ems的CDN更换为官方的https://cdn.jsdelivr.net/npm/[email protected]/dist/antd.esm.js后,正常运行了, 为什么从v4开启 官方不提供打包的esm文件呢

@kovsu
Copy link
Member

kovsu commented Sep 21, 2023

Duplicate of #6960

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants