SyntaxError: ambiguous indirect export: default Error when importing my own class
Full error message
I have written a validation class and want to include it in my VueJS 3 project. Unfortunately I get the following error: SyntaxError: ambiguous indirect export: default
This is my code:
// ..classes/formValidationClass.js
export class FormValidator {
...
}
// some vue file with a form
import FormValidation from "..classes/formValidationClass"
export default {...}
What does this error mean and what do I have to do to correct the error?Solutionsource: stackoverflow \u2197
Use braces {} around your import Name // ..classes/formValidatorClass.js // Comment: => suggestion change your file name to similar your class name export class FormValidator { ... } // some vue file with a form // import FormValidation from "..classes/formValidationClass" import { FormValidator as FormValidation} from "../classes/formValidatorClass"; // Comment: => use brackets around your import name. if you want use FormValidation you can use also a alias (`originalName as newName`) export default {...}
API access
Get this solution programmatically \u2014 free, no authentication.
curl https://depscope.dev/api/error/7fc826821f0d195124954a21416f32c3c83e5aed8b57780528a4f2b08f1eeeebhash \u00b7 7fc826821f0d195124954a21416f32c3c83e5aed8b57780528a4f2b08f1eeeeb