Skip to content

Hello world with webpack and "production" mode raises CustomElementRegistry.define not a valid name #143

Answered by koddsson
betatim asked this question in Q&A
Discussion options

You must be logged in to vote

Not sure why but it seems like the name of the variable that the class is assigned to w is used when generating the custom element name. A clue towards what is going wrong?

Webpack is mangling the class name during minification. Since catalyst will get the class name at runtime and register a custom element from that name, you need to make sure that class names aren't changed during modification.

I'm not sure how this is done in webpack. The minified that I'm most familiar with: terser has an option to keep class names unmangled.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@betatim
Comment options

Answer selected by betatim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants