Skip to content

Uncaught TypeError: (!0) is not a function #11897

@raimund-schluessler

Description

@raimund-schluessler

Bug report

I hope this is the correct repository and it is actually webpacks fault. If it is not, please excuse me in advance.

What is the current behavior?

Webpack production build creates a file which gives the following error: Uncaught TypeError: (!0) is not a function. The development build runs fine. The compiled javascript file contains this part which seems the reason for the error:

s._withStripped=(!0)((function(){const e=//stripped the rest

If the current behavior is a bug, please provide the steps to reproduce.

I tried to build a custom Vue app for Nextcloud containing a component with this javascript part

<script>
import { getFilePickerBuilder } from '@nextcloud/dialogs'

export default {
	methods: {
		async selectFolder() {
			const folder = await this.$store.dispatch('getAttachmentFolder')

			const path = await getFilePickerBuilder(t('inventory', 'Select attachment folder'))
				.addMimeTypeFilter('httpd/unix-directory')
				.startAt(folder)
				.allowDirectories(true)
				.build()
				.pick()

			this.$store.dispatch('setAttachmentFolder', { path })
		},
	},
}
</script>

Commenting out the getFilePickerBuilder line circumvents the issue, however, it's most certainly not the underlying cause as I use getFilePickerBuilder at a different place without issues.

As far as I can tell, the build run fine on webpack 4. If it helps, I can upload the complete javascript file which webpack produced.

What is the expected behavior?

The file should compile to valid javascript, also in production mode.

Other relevant information:
webpack version: 5.3.2
Node.js version: v10.19.0
Operating System: Ubuntu 20.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions