==== What is the problem?
When switching from Source to Visual Editor with wikitext the `[[constructor:foo]]`, I get the JS error (in Chromium):
```
Title.js:112 Uncaught TypeError: Cannot read properties of undefined (reading 'replace')
at getNamespacePrefix (Title.js:112:59)
at Title.getNamespacePrefix (Title.js:803:10)
at Title.getPrefixedDb (Title.js:917:15)
at Title.getPrefixedText (Title.js:928:21)
at ve.dm.MWInternalLinkAnnotation.static.normalizeTitle (ve.dm.MWInternalLinkAnnotation.js:167:15)
at ve.dm.MWInternalLinkAnnotation.static.toDataElement (ve.dm.MWInternalLinkAnnotation.js:84:26)
at ve.dm.ModelFromDomConverter.createDataElements (ve.dm.ModelFromDomConverter.js:271:39)
at ve.dm.ModelFromDomConverter.getDataFromDomSubtree (ve.dm.ModelFromDomConverter.js:553:34)
at ve.dm.ModelFromDomConverter.getDataFromDomSubtree (ve.dm.ModelFromDomConverter.js:697:13)
at ve.dm.ModelFromDomConverter.getModelFromDom (ve.dm.ModelFromDomConverter.js:328:20)
...
```
On Firefox:
```
Uncaught TypeError: can't access property "replace", mw.config.get(...)[namespace] is undefined
...
```
==== Steps to reproduce problem
# https://en.wikipedia.beta.wmcloud.org/wiki/BeforeEach-name-0.19824699936685874-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n?action=edit&veswitched=1
# Make sure you are in the Source Editor
# Enter `[[constructor:foo]]`
# Open the JavaScript console
# Switch to Visual Editor
==== Environment
**Browser:** Firefox 140. Chromium 141.
**Wiki(s):** https://en.wikipedia.beta.wmcloud.org MediaWiki 1.46.0-alpha (dc7034b) 09:53, 4 November 2025.
**Editor:** VisualEditor – (d0e31dd) 09:51, 3 November 2025.