Closed krko12345 closed 4 months ago
The problem seems to move to next line if I modify it to use parent directory path (instead of current directory) for the import
Hmm I cannot reproduce this. I think you are correct that its may have something to do with 'env.d.ts' file. What happens if you remove the "declare module " statement?
@davidnixon Error remained even after removal of all declarations from "env.d.ts". It wouldn't be a solution anyway because without declarations the code would fail to compile from typescript.
I also must say that I use there practically all carbon components, and cv-file-uploader is the only one having this issue.
This issue has been marked as stale because it has required additional info or a response from the author for over 14 days. When you get the chance, please comment with the additional info requested. Otherwise, this issue will be closed in 14 days.
Not sure what more should I include in my response. The problem still persists as described.
I only managed to avoid the problem by having a modified copy of CvFileUploader component, where I have removed the CvForm wrapper. As mentioned, other carbon components work for me as expected.
I do not think I fully understand the use case but I think I do see the issue. Several index files import like this:
import CvForm from './CvForm';
Notice the lack of ".vue" extension! I updated those places to import like this:
import CvForm from './CvForm.vue';
Could you try this patch? carbon-vue-3.0.16-5f775.tgz
npm remove @carbon/vue
npm add ./carbon-vue-3.0.16-5f775.tgz
Another possible fix. Can you remove "declare module '@carbon/vue/src/components/*'"? I think maybe your use case is related to an issue @OlkaB resolved in April. #1578 which nows allow you to import individual components. So this should work without the declare module
.
import { CvFileUploader } from '@carbon/vue';
@davidnixon I confirm, the CvFileUploader component worked as expected while using carbon-vue-3.0.16-5f775.tgz
This issue has been marked as stale because it has required additional info or a response from the author for over 14 days. When you get the chance, please comment with the additional info requested. Otherwise, this issue will be closed in 14 days.
Fixed in #1606
Failed to resolve import
Detailed description
CvFileUploader throws error when used in my project. The error is "Failed to resolve import", which is related to CvForm component import in the file-uploader component.
In my env.d.ts I have declared the path as "declare module '@carbon/vue/src/components/*'", and I tried with different variations as well.
Still getting error:
What works for me is to modify the CvFileUploader component and remove the CvForm wrapper inside, but of course that's not permanent solution.
Any recommendation? Is this a bug?
Steps to reproduce the issue
Additional information