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

fix(useWebWorker): IIFE does not pack the @vueuse/shared package in … #2433

Closed
wants to merge 2 commits into from

Conversation

CatsAndMice
Copy link

#2421

Description

  • 在文件scripts/rollup.config.ts中,关于iife的设置仅将vue-demi注入了,并没有把shared工具包注入
  • 当以cdn链接引入@vueuse/core包时,使用shared工具包提供的方法或常量均为undefined
  • 不仅是@vueuse/core,像@vueuse/rxjs也是一样的,如果使用了shared工具包均会报错

例如:
@vueuse/rxjs中提供的useSubscription方法,它需要使用'@vueuse/shared提供的tryOnScopeDispose方法。
image
image
执行useSubscription会报错

解决:

  • shared工具包也像vue-demi进行注入设置
  • 在打包shared工具包自己时,注入操作去除即可

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@CatsAndMice
Copy link
Author

@victortolbert @benatkin @waldi @neelance 请帮我看下这个PR是否可以合并

@stale
Copy link

stale bot commented Jan 18, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 18, 2023
@antfu
Copy link
Member

antfu commented Jan 20, 2023

It's on the docs, you have to import the shared package: https://github.com/vueuse/vueuse#cdn

@antfu antfu closed this Jan 20, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants