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

fixed empty/no script tag in vue component error #192

Merged
merged 2 commits into from
Dec 14, 2022

Conversation

adamDilger
Copy link

This should fix #191 if I've understood what vue-preprocessor.ts does

If there is no script value, just return the code as is

Copy link
Collaborator

@byara byara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution. Could you please use this example and also some variation of it in the snapshot tests?

<template>
	<div>
		<span>hello world
		</span></div>
</template>

<script>
// I am top level comment in this file.
// I am second line of top level comment in this file.
import threeLevelRelativePath from '../../../threeLevelRelativePath';
import sameLevelRelativePath from './sameLevelRelativePath';
import thirdParty from 'third-party';
import React from 'react';
export { random } from './random';
import oneLevelRelativePath from '../oneLevelRelativePath';
import otherthing from '@core/otherthing';
import twoLevelRelativePath from '../../twoLevelRelativePath';
import component from '@ui/hello';
export default {
    title: 'hello',
};
import fourLevelRelativePath from '../../../../fourLevelRelativePath';
import something from '@server/something';
function add(a, b) {
    return a + b;
}
</script>

<style>
div { color: red; }
</style>

These kinds of tests help us to catch unwanted changes through out the code.
Thank 👍

@adamDilger
Copy link
Author

@byara From the looks it seems that there are already a few examples/variations of a standard component in the snapshots, so instead I've added the bug offending scenario (a component with no script tag). Is that all good?

Thanks!

Copy link
Collaborator

@byara byara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the changes 👍

@byara byara merged commit e1a32fd into trivago:master Dec 14, 2022
@ayusharma
Copy link
Collaborator

Released in v4.1.0. I appreciate your patience. ❤️

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

Successfully merging this pull request may close these issues.

Empty or missing script tag in Vue component causes error
5 participants