-
Notifications
You must be signed in to change notification settings - Fork 58
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
import { message } from "ant-design-vue" fails, since v1.2.0 #37
Comments
same as you pnpm not work |
1.1.1 export function resolveNodeModules(root: string, ...dir: string[]) {
return normalizePath(path.join(root, 'node_modules', ...dir));
} 1.2.0+ export function resolveNodeModules(libName: string, ...dir: string[]) {
const modulePath = require.resolve(libName)
const lastIndex = modulePath.indexOf(libName)
return normalizePath(path.resolve(modulePath.substring(0, lastIndex), ...dir))
} |
pnpm:
|
For me, it has to be configured as following to work properly with pnpm:
|
I have a similar issue in this branch of one of my repo https://github.com/franxois/vite-react-antd-storybook/tree/issue-with-style-import The project have "antd" in the name, I clone it in a folder with "antd" in the name and I get the error 14:45:56 [vite] Internal server error: Failed to resolve import "/Users/Francois/Documents/dev/github.com/franxois/vite-react-/antd/es/button/style/index" from "src/App.tsx". Does the file exist? I think the string replace catch the main folder name instead of the one in node_modules. In my case I can fix the issue by replacing ...antd... by ...anttd... in my projetc folder name |
fix 1.4.0 |
[vite] Internal server error: Failed to resolve import "xxx/node_modules/.pnpm/registry.nlark.com+/ant-design-vue/es/message/style/index" from "xxx". Does the file exist?
This error doesn't occur with v1.1.1
The text was updated successfully, but these errors were encountered: