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

Importing type does not work from quasar if the 'js-transform-quasar-imports" rule is enabled #55

Open
Tofandel opened this issue Sep 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Tofandel
Copy link
Contributor

Tofandel commented Sep 23, 2024

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Add to your app.ts

import { Dialog, Notify, Quasar, type QuasarPlugins } from 'quasar';
import { createApp } from 'vue';

const vue = createApp({
        inheritAttrs: false,
      }).use(Quasar, {
          plugins: [Dialog, Notify] as QuasarPlugins,
        })

Or to any other file import a type from quasar

import { QTableProps } from 'quasar';

The build fails with error
Error: Unknown import from Quasar: QTableProps

If you remove the rule from webpack, then it all imports correctly

This is because the plugin runs a "dumb" transform on the import and doesn't know if the user is importing a type or an actual js export

This works correctly if the js-transform-quasar-imports is added before the ts-loader but it's not the case by default

Expected behavior
The build to not fail when importing a type

@Tofandel Tofandel added the bug Something isn't working label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant