Skip to content
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

Error: The requested module does not provide an export named 'default' #29

Open
Dylan190774 opened this issue May 5, 2024 · 0 comments

Comments

@Dylan190774
Copy link

Dylan190774 commented May 5, 2024

I use the Quasar Framework, which uses Vite 5 with Typescript.

I added this to compilerOptions in tsconfig.json:
"types": ["@modyfi/vite-plugin-yaml/modules"]

The app runs fine, until the yaml file is read with:
import settings_yaml from './../assets/yaml/settings.yaml';
I get the following error in the console, and the app stops functioning:
SyntaxError: The requested module '/src/assets/yaml/settings.yaml?t=1714951438630&import' does not provide an export named 'default' (at settings.ts?t=1714951555254:3:8)

The contents of the settings.yaml file is just this:

en:
  level: level
nl:
  level: niveau


Any idea why this is happening?

And when I add --- to the top of the yaml file, I get:
SyntaxError: Invalid left-hand side expression in prefix operation (at settings.yaml?t=1714952403955&import:1:3)

I resorted back to using a JSON file for now, but I'd really like to be able to use a YAML file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant