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

optimizeDeps does not process aliased imports #8867

Closed
7 tasks done
danielroe opened this issue Jun 30, 2022 · 0 comments · Fixed by #8869
Closed
7 tasks done

optimizeDeps does not process aliased imports #8867

danielroe opened this issue Jun 30, 2022 · 0 comments · Fixed by #8869

Comments

@danielroe
Copy link
Contributor

danielroe commented Jun 30, 2022

Describe the bug

Background: In Nuxt, we need to use the CJS versions of some Vue dependencies as these will not suffer from memory leaks when running on the server. (The ESM versions should not be run on the server.) So we alias them in advance in resolve.alias.

The bug: When using the new optimizeDeps treatment in Vite, dependencies aliased to absolute paths are not processed, leading to an error like:

Error: 'isFunction' is not exported by node_modules/@vue/shared/dist/shared.cjs.prod.js, imported by src/main.js

(Possible workaround seems to be not fully resolving them.)

Reproduction

https://stackblitz.com/edit/vitejs-vite-r2pbvz

System Info

Stackblitz with:

{
  "@vue/shared": "^3.2.37",
  "vite": "~3.0.0-beta.5"
}

Used Package Manager

npm

Logs

No response

Validations

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant