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

chore: use lodash-es to support vite #2777

Merged
merged 1 commit into from
Sep 2, 2020

Conversation

CarterLi
Copy link
Contributor

@CarterLi CarterLi commented Sep 2, 2020

This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Branch merge
  • Other (about what?)

What's the background?

  1. Describe the source of requirement.
  2. Resolve what problem.
  3. Related issue link.

We still use lodash, which uses the old commonjs module system and doesn't play well with vite.

Which results the errors: Uncaught (in promise) SyntaxError: The requested module '/@modules/lodash/isPlainObject.js' does not provide an export named 'default'

This PR replace all uses of lodash to lodash-es

API Realization (Optional if not new feature)

  1. Basic thought of solution and other optional proposal.
  2. List final API realization and usage sample.
  3. GIF or snapshot should be provided if includes UI/interactive modification.

What's the effect? (Optional if not new feature)

  1. Does this PR affect user? Which part will be affected?
  2. What will say in changelog?
  3. Does this PR contains potential break change or other risk?

Shouldn't have any behavior change

Changelog description (Optional if not new feature)

  1. English description
  2. Chinese description (optional)
  1. chore: use lodash-es to support vite
  2. 事务性:使用 lodash-es 以支持 vite

Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Additional Plan? (Optional if not new feature)

If this PR related with other PR or following info. You can type here.

To fix error: `Uncaught (in promise) SyntaxError: The requested module
'/@modules/lodash/isPlainObject.js' does not provide an export named
'default'`
@tangjinzhou tangjinzhou merged commit fb52b36 into vueComponent:feat-vue3 Sep 2, 2020
@TonyLuo
Copy link

TonyLuo commented Sep 3, 2020

vite 报错:
(index):1 Uncaught SyntaxError: The requested module '/@modules/tinycolor2/tinycolor.js' does not provide an export named 'default'

@CarterLi
Copy link
Contributor Author

CarterLi commented Sep 3, 2020

还有raf也报错。。。

@tangjinzhou
Copy link
Member

vite 用的什么版本,哪个组件报错,新开issue 反馈吧 @TonyLuo @CarterLi

@tangjinzhou
Copy link
Member

其实 lodash 在我这里也没有问题 😅

@github-actions
Copy link

github-actions bot commented Sep 4, 2021

This pull request 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 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants