Skip to content

[Bug Report] Web: NEXT_PUBLIC_INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH from .env.* does not take effect in Chunk Settings #30461

@hsiong

Description

@hsiong

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

v.11.2

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

  1. Configure the web env exactly following web/.env.example. Set only:

    NEXT_PUBLIC_INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH=40000
    
  2. Rebuild and restart the web service:

    docker compose up -d --build web
    
  3. Open the web UI:
    Chunk Settings → General → Maximum chunk length

    Observe the maximum value.

  4. Check the page-injected value in browser console:

    document.body.getAttribute('data-public-indexing-max-segmentation-tokens-length')
    

✔️ Expected Behavior

  1. Open the web UI: Chunk Settings → General → Maximum chunk length
    The maximum value is still 8000.
  2. In the browser console, the injected value is empty:
document.body.getAttribute('data-public-indexing-max-segmentation-tokens-length')

Result:

'8000'

❌ Actual Behavior

  1. Open the web UI: Chunk Settings → General → Maximum chunk length
    The maximum value is still 4000 (not 8000).
  2. In the browser console, the injected value is empty:
document.body.getAttribute('data-public-indexing-max-segmentation-tokens-length')

Result:

''

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions