Skip to content

Fix "Can't parse pine": read the compiled script from its new location - #355

Merged
Mathieu2301 merged 1 commit into
mainfrom
fix/pine-script-location
Oct 30, 2026
Merged

Mathieu2301 merged 1 commit into
mainfrom
fix/pine-script-location

Conversation

@Mathieu2301

Copy link
Copy Markdown
Owner

Problem

Since 27 Oct 2026, every Pine study fails with study_error "Can't parse pine": built-in (STD;RSI), public and private (USER;…) scripts alike, on 3.5.x and 4.x. #354 reported it, but no fix had shipped.

TradingView moved the compiled script (ILScript, prefix bmI9Ks46_) out of pine-facade/translate's result.ilTemplate:

  1. 27 Oct: into the defval of the hidden text input (the workaround posted in Pine studies fail with "Can't parse pine": pine-facade translate no longer returns ilTemplate #354).
  2. By 30 Oct: into result.metaInfo.defaults.inputs.text. The text input's defval is now empty, so the Pine studies fail with "Can't parse pine": pine-facade translate no longer returns ilTemplate #354 workaround no longer works either.
curl -s 'https://pine-facade.tradingview.com/pine-facade/translate/STD%3BRSI/last' \
  | jq '{keys: (.result | keys), defaultsText: .result.metaInfo.defaults.inputs.text[0:12]}'
# {"keys": ["metaInfo"], "defaultsText": "bmI9Ks46_n86"}

Fix

  • compiledScriptOf(result) reads result.ilTemplate, then the text input's defval, then metaInfo.defaults.inputs.text. Only values with the compiled-script prefix are accepted, so a rollback on TradingView's side keeps working.
  • getIndicator() throws a clear PARSE_ERROR when no compiled script is found, instead of creating an empty study that fails later on the chart.

Verification

  • Unit tests for the three shapes and for non-script values (tests/unit/indicators.test.ts).
  • npm run typecheck, lint, test (211 passed), build, smoke.
  • Live, authenticated session, BINANCE:BTCUSDT 1h: STD;RSI and a private USER;… indicator each return 150 periods with this branch. With the published 4.1.0, both fail with Can't parse pine.

Fixes #354

TradingView moved the compiled Pine script (ILScript) out of
`pine-facade/translate`'s `result.ilTemplate`: first to the `defval` of the
hidden `text` input (27 Oct 2026), and by 30 Oct to
`result.metaInfo.defaults.inputs.text`. Studies were created with no script
and the chart server answered `study_error` "Can't parse pine", for
built-in (STD;), public and private (USER;) indicators alike.

`compiledScriptOf()` reads all three locations, newest last, so a rollback
on TradingView's side keeps working. `getIndicator()` now throws a clear
PARSE_ERROR when no compiled script is found instead of failing later on
the chart.

Verified live with an authenticated session: STD;RSI and a private USER;
indicator return data again (150 periods each), while 4.1.0 fails on both.

Fixes #354
@Mathieu2301
Mathieu2301 merged commit acb37c5 into main Oct 30, 2026
12 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.

Pine studies fail with "Can't parse pine": pine-facade translate no longer returns ilTemplate

1 participant