Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@martyf
Copy link
Contributor

@martyf martyf commented Dec 3, 2025

Statamic 6 Alpha 18 introduced a JS error for a site that was operational in Alpha 17.

This is the error from the Alpha 18 build:

TypeError: can't access property "replaceAll", V is undefined
    escapeHtml$1 http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:250
    xt http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:312
    xt http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:312
    refreshComputed http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:10
    isDirty http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:10
    runIfDirty http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:10
    callWithErrorHandling http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:17
    flushJobs$1 http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:17
    flushJobs$1 http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:17
    promise callback*queueFlush$1 http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:17
    queueJob$1 http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:17
    scheduler http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:18
    scheduler http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:10
    trigger http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:10
    endBatch http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:10
    trigger$1 http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:10
    set http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:10
    set http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:18
    mounted http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:251
    1 http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:251
    mounted http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:251
    createHook http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:18
    callWithErrorHandling http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:17
    callWithAsyncErrorHandling http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:17
    __weh http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:18
    flushPostFlushCbs http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:17
    Dn http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:18
    mount http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:18
    mount http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:26
    setup http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:313
    Xe http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:129
    promise callback*createInertiaApp http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:129
    start http://flo-girls.test/vendor/statamic/cp/build/assets/index-U5zKWNn2.js:313
    <anonymous> data:text/javascript;base64,U3RhdGFtaWMuY29uZmlnKFN0YXRhbWljQ29uZmlnKTsgU3RhdGFtaWMuc3RhcnQoKQ==:1
index-U5zKWNn2.js:17:2961

Here is the error from the dev build:

Uncaught (in promise) TypeError: can't access property "replaceAll", string is undefined
    escapeHtml globals.js:128
    previewText Set.vue:101
    previewText Set.vue:92
    refreshComputed reactivity.esm-bundler.js:391
    get value reactivity.esm-bundler.js:1648
    unref reactivity.esm-bundler.js:1493
    get reactivity.esm-bundler.js:1499
    _sfc_render Set.vue:169
    renderComponentRoot runtime-core.esm-bundler.js:6560
    componentUpdateFn runtime-core.esm-bundler.js:5429
    run reactivity.esm-bundler.js:237
    runIfDirty reactivity.esm-bundler.js:275
    callWithErrorHandling runtime-core.esm-bundler.js:199
    flushJobs runtime-core.esm-bundler.js:408
    flushJobs runtime-core.esm-bundler.js:430
    promise callback*queueFlush runtime-core.esm-bundler.js:322
    queueJob runtime-core.esm-bundler.js:317
    scheduler runtime-core.esm-bundler.js:5480
    trigger reactivity.esm-bundler.js:265
    endBatch reactivity.esm-bundler.js:323
    trigger reactivity.esm-bundler.js:741
    set reactivity.esm-bundler.js:1024
    data_set globals.js:48
    setFieldMeta Container.vue:179
    metaUpdated Field.vue:101
    callWithErrorHandling runtime-core.esm-bundler.js:199
    callWithAsyncErrorHandling runtime-core.esm-bundler.js:206
    emit runtime-core.esm-bundler.js:6444
    updateMeta Fieldtype.vue:32
    updateRowMeta ManagesRowMeta.js:4
    updateSetMeta ManagesSetMeta.js:8
    addSet Replicator.vue:209
    callWithErrorHandling runtime-core.esm-bundler.js:199
    callWithAsyncErrorHandling runtime-core.esm-bundler.js:206
    emit runtime-core.esm-bundler.js:6444
    createSetupContext/get emit/< runtime-core.esm-bundler.js:8157
    addSet AddSetButton.vue:50
    callWithErrorHandling runtime-core.esm-bundler.js:199
    callWithAsyncErrorHandling runtime-core.esm-bundler.js:206
    emit runtime-core.esm-bundler.js:6444
    addSet SetPicker.vue:363
    singleButtonClicked SetPicker.vue:428
    callWithErrorHandling runtime-core.esm-bundler.js:199
    callWithAsyncErrorHandling runtime-core.esm-bundler.js:206
    invoker runtime-dom.esm-bundler.js:729
    addEventListener runtime-dom.esm-bundler.js:680
    patchEvent runtime-dom.esm-bundler.js:698
    patchProp runtime-dom.esm-bundler.js:775
    mountElement runtime-core.esm-bundler.js:4904
    processElement runtime-core.esm-bundler.js:4851
    patch runtime-core.esm-bundler.js:4717
    componentUpdateFn runtime-core.esm-bundler.js:5358
    run reactivity.esm-bundler.js:237
    setupRenderEffect runtime-core.esm-bundler.js:5486
    mountComponent runtime-core.esm-bundler.js:5260
    processComponent runtime-core.esm-bundler.js:5213
    patch runtime-core.esm-bundler.js:4729
    componentUpdateFn runtime-core.esm-bundler.js:5358
    run reactivity.esm-bundler.js:237
    setupRenderEffect runtime-core.esm-bundler.js:5486
    mountComponent runtime-core.esm-bundler.js:5260
    processComponent runtime-core.esm-bundler.js:5213
    patch runtime-core.esm-bundler.js:4729
    componentUpdateFn runtime-core.esm-bundler.js:5358
    run reactivity.esm-bundler.js:237
    setupRenderEffect runtime-core.esm-bundler.js:5486
    mountComponent runtime-core.esm-bundler.js:5260
    processComponent runtime-core.esm-bundler.js:5213
    patch runtime-core.esm-bundler.js:4729
    mountChildren runtime-core.esm-bundler.js:4963
    mountElement runtime-core.esm-bundler.js:4886
    processElement runtime-core.esm-bundler.js:4851
    patch runtime-core.esm-bundler.js:4717
    mountChildren runtime-core.esm-bundler.js:4963
    mountElement runtime-core.esm-bundler.js:4886
12 globals.js:128:5

Tracing this through, when the Preview Text in the replicator/Set.vue file is being generated, some value props at the map were undefined and not a proxy.

This lead to an undefined value being passed through to the replaceAll global helper.

This PR adds undefined to the filter step of the preview generation to prevent this error.

I have a private repo I can share if you want the source Blueprints and Fieldsets that are triggering the error, and is triggering on the dev build when adding a Replicator set to the page (and on the 'prod' build, when loading a page that was saved)

Not sure if this the best approach - and what was added between 17 and 18 that caused this to start. Not sure if something in #13113 added this?

@jasonvarga jasonvarga merged commit 5aacaa7 into statamic:master Dec 5, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants