What is the problem?

When switching from Source to Visual Editor with wikitext [[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
  1. 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
  2. Make sure you are in the Source Editor
  3. Enter [[constructor:foo]]
  4. Open the JavaScript console
  5. 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.