Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Broken Vue 3 typescript #400

Open
Open
@iassasin

Description

@iassasin

Version

6.0.0-beta10

Reproduction link

https://github.com/iassasin/vue3-rollup-ts-bug

Steps to reproduce

Clone example repository and npm run build.

What is expected?

working bundle

What is actually happening?

[!] (plugin typescript) Error: Could not load .../MainView.vue?vue&type=script&lang.ts (imported by MainView.vue): Debug Failure. False expression: Expected fileName to be present in command line

What I did wrong? Looks like rollup-plugin-vue bug.

Activity

pinned this issue on Oct 22, 2020
added this to the Zero Issues milestone on Oct 22, 2020
Smashman

Smashman commented on Oct 23, 2020

@Smashman

Ensure that the rollup-plugin-vue plugin is run before @rollup/plugin-typescript.

iassasin

iassasin commented on Oct 24, 2020

@iassasin
Author

@Smashman, if use this order of plugins, then error changes:

	plugins: [
		alias({
			resolve: [ '.js', '.ts' ],
			entries: [
				{ find: 'vue', replacement: 'node_modules/vue/dist/vue.runtime.esm-browser.js' }
			]
		}),
		resolve(),
		Vue({ preprocessStyles: true }),
		typescript(),
		css({ output: 'dist/app.css' }),
	],

Error:

Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
    at error (.../vue3-rollup-bug/node_modules/rollup/dist/shared/rollup.js:5215:30)

Looks like typescript doesn't recognized at all.

Btw, see issue in typescript plugin (rollup/plugins#608), maybe this issue doesn't related to rollup-plugin-vue, because with rollup-plugin-typescript2 config from my reproduction works great.

kris-ellery

kris-ellery commented on Nov 24, 2020

@kris-ellery

@iassasin I had the same issue, switching from @rollup/plugin-typescript to rollup-plugin-typescript2 fixed it.

iassasin

iassasin commented on Nov 25, 2020

@iassasin
Author

@kris-ellery, yes, I use this workaround too, but it's strange if it shouldn't work with official ts plugin.

Mister-Hope

Mister-Hope commented on Jan 6, 2021

@Mister-Hope

it's strange if it shouldn't work with official ts plugin.

Agree with that, I waste 15 minutes on the official plugin before finding out the example is using rollup-plugin-typescript2

mnlipp

mnlipp commented on Feb 28, 2021

@mnlipp

I think its a bug in the "official plugin" (see rollup/plugins#608).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @mnlipp@znck@kris-ellery@Smashman@iassasin

        Issue actions

          Broken Vue 3 typescript · Issue #400 · vuejs/rollup-plugin-vue