-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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: resolve error in deepimport #5886
Conversation
Hi, the current behavior seems consistent with node resolver:
The spec may not be clear around whether an export mapping from Retrying resolve with index lookup seems to defeat exports specs in many (other) ways. My 2c. |
If @gluck confirmed this is intended behaviour by node, I think we should lean on that and not have this change. Unless we figure out the |
Maybe it's |
@bluwy Maybe we can fix the problem in vite layer? The kind of writing is frequent, some third-party ui library like import { Button } from 'antd'
=> import Button from 'antd/lib/button'
import 'antd/lib/button/style'
|
I don't think Vite should deviate from the spec as it's one of its philosophies. Re-reading But regarding "./lib/*": "./lib/*/index.js" would work. Re |
Ok, thanks a lot 😄 |
Description
Mentioned #3039, there are only
tryindex
when no exports field. It will be error in below code.Maybe there should
tryindex
again when no resolved ortryindex
always.Additional context
There is a reproduction
$ git clone git@github.com:zhangyuang/vite-ssr-error-require.git $ git checkout bug/tryindex $ yarn && yarn dev
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).