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

CDN Script fails #2844

Closed
enyachen opened this issue Aug 15, 2022 · 5 comments
Closed

CDN Script fails #2844

enyachen opened this issue Aug 15, 2022 · 5 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@enyachen
Copy link

Describe the bug

The CDN script https://unpkg.com/primevue@^3/core/core.min.js causes the following errors:

  • Uncaught SyntaxError: Unexpected token ']'
  • Uncaught TypeError: Cannot destructure property 'FilterMatchMode' of 'primevue.api' as it is undefined.

Reproducer

No response

PrimeVue version

3.16.0

Vue version

3.x

Language

ES6

Build / Runtime

Vue CLI App

Browser(s)

Chrome

Steps to reproduce the behavior

`

<!-- PrimeVue -->
<link href="https://unpkg.com/primevue@^3/resources/themes/saga-blue/theme.css" rel="stylesheet" />
<link href="https://unpkg.com/primevue@^3/resources/primevue.min.css" rel="stylesheet" />
<link href="https://unpkg.com/primeflex@^3/primeflex.min.css" rel="stylesheet" />
<link href="https://unpkg.com/primeicons/primeicons.css" rel="stylesheet" />

<!-- Dependencies -->
<script src="https://unpkg.com/vue@next"></script>
<script src="https://unpkg.com/primevue@^3/core/core.min.js"></script>

<!-- Demo -->
<script src="https://unpkg.com/primevue@^3/datatable/datatable.min.js"></script>
<script src="https://unpkg.com/primevue@^3/column/column.min.js"></script>
<script src="https://unpkg.com/primevue@^3/multiselect/multiselect.min.js"></script>
<script src="https://unpkg.com/primevue@^3/calendar/calendar.min.js"></script>
		<template #header>
			<div class="flex justify-content-between">
				<p-button type="button" icon="pi pi-filter-slash" label="Clear" class="p-button-outlined" @click="clearFilter()"></p-button>
				<span class="p-input-icon-left">
					<i class="pi pi-search"></i>
					<p-inputtext v-model="filters['global'].value" placeholder="Search"></p-inputtext>
				</span>
			</div>
		</template>

		<p-column field="location" header="Location" :sortable="true">
			<template #body="{data}">
				{% raw %}
				{{data.location}}
				{% endraw %}
			</template>
			<template #filter="{filterModel}">
				<p-inputtext type="text" v-model="filterModel.value" class="p-column-filter" placeholder="Search by location"></p-inputtext>
			</template>
		</p-column>

	</p-datatable>
</div>
<script type="module"> const { createApp } = Vue; const { FilterMatchMode, FilterOperator } = primevue.api; const App = { created() { this.initFilters(); }, methods: { initFilters() { this.filters = { 'global': {value: null, matchMode: FilterMatchMode.CONTAINS}, 'location': {operator: FilterOperator.AND, constraints: [{value: null, matchMode: FilterMatchMode.CONTAINS}]}, } }, clearFilter() { this.initFilters(); }, }, components: { "p-datatable": primevue.datatable, "p-column": primevue.column, "p-inputtext": primevue.inputtext, "p-button": primevue.button, "p-multiselect": primevue.multiselect, "p-calendar": primevue.calendar, "p-inputnumber": primevue.inputnumber, "p-dropdown": primevue.dropdown, }, data() { return { filters: {}, jobs: [ ] } }, }; const app = createApp(App); app.use(primevue.config.default); app.mount("#app"); </script> `

Expected behavior

No response

@enyachen enyachen added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Aug 15, 2022
@mertsincan mertsincan self-assigned this Aug 15, 2022
@tugcekucukoglu tugcekucukoglu added this to the 3.16.1 milestone Aug 16, 2022
@mertsincan
Copy link
Member

Fixed now. Thank you!

@h00jie
Copy link

h00jie commented Aug 17, 2022

It seems its not working yet

@mertsincan
Copy link
Member

Could you please try it with v3.16.1?

@h00jie
Copy link

h00jie commented Aug 17, 2022

Yes you are right, excuse me ... probably my browser cached something

@mertsincan
Copy link
Member

No problem! Thanks a lot for your update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

4 participants