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
使用TypeScript时似乎缺少 “@types/node” 依赖,以及路径别名问题 #12
Comments
不应该是 |
没有直接import组件。项目创建完成后没有改动代码, 我粘贴的是控制台打印的错误 |
Mac os 上正常。 |
似乎是 |
是的……感谢指出 |
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
// "@": fileURLToPath(new URL("./src", import.meta.url)),
// "@/": fileURLToPath(new URL("./src", import.meta.url)), //error
// "@": fileURLToPath(new URL("./src/", import.meta.url)),
// '@/': fileURLToPath(new URL('./src/', import.meta.url))
},
},
}); 测试了这四种情况,只有第二种会报错。 |
看一下最近的 commit,已经修复了 // "@": fileURLToPath(new URL("./src", import.meta.url)),
// "@/": fileURLToPath(new URL("./src", import.meta.url)), //error
// "@": fileURLToPath(new URL("./src/", import.meta.url)),
// '@/': fileURLToPath(new URL('./src/', import.meta.url)) //error |
有点奇怪,我本地第四种是正常进入的,组件也都能加载。 |
使用TypeScript时似乎缺少 “@types/node” 依赖
路径别名配置似乎也有问题
The text was updated successfully, but these errors were encountered: