-
Notifications
You must be signed in to change notification settings - Fork 49
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
Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': "n" is not a valid custom element name #163
Comments
This is documented in "Build considerations" from https://github.github.io/catalyst/guide/you-will-need/
What minifier are you using in your production builds? |
Oh... I see. That does make sense! Thank you so much for that link.
I don't know yet. I don't understand the whole webpack/build config. I just used what rails gave me. I will figure out and come back here soon. This is my package.json. {
"name": "Project",
"private": true,
"dependencies": {
"@babel/preset-typescript": "^7.16.7",
"@babel/plugin-proposal-decorators": "^7.16.7",
"@github/catalyst": "^1.1.4",
"@github/jtml": "^0.4.0",
"@github/template-parts": "^0.3.2",
"@popperjs/core": "^2.9.2",
"@rails/actioncable": "^6.0.0",
"@rails/activestorage": "^6.0.0",
"@rails/ujs": "^6.0.0",
"@rails/webpacker": "5.4.3",
"bootstrap": "^5.0.0",
"delegated-events": "^1.1.2",
"jquery": "^3.6.0",
"minimist": "^1.2.5",
"prettier": "^2.3.1",
"selector-observer": "^2.1.6",
"turbolinks": "^5.2.0",
"typescript": "^4.5.5",
"webpack-cli": "^4.9.2"
},
"version": "0.1.0",
"devDependencies": {
"@webpack-cli/serve": "^1.6.1",
"jest": "^27.1.0",
"webpack-dev-server": "^4.7.3"
},
"engines": {
"node": "14.18.3"
}
} |
Do you have any configuration for webpack? I don't actually know how webpacker works and how it's configured in Rails 6 😬 |
I think it uses Terser as a minifier, but it appears my config changes won't affect the build. I tried setting My webpack config
My Babel config
I think this is a Thank you for your help identifying the problem @koddsson! |
Hey there 👋🏻
I created a couple of custom elements using catalyst and it worked just fine, once a managed to get decorators to work with Rails 6 webpacker. However, once I deployed it to heroku, I got the following error in the console:
That error broke the entire application.js. My
nearby_facility_inputs.ts
is this:I am not sure this is a catalyst specific error. I suppose not. I think this is a transpilation error, but I am unfamiliar with the whole webpack babel thing I decided to ask for some directions here.
Also, I am wondering how could I make those custom elements not break the entire application.js - perhaps I could wrap some code in a
try/catch
?Thank you in advance ❤️
The text was updated successfully, but these errors were encountered: