Repository navigation
Fix "Can't parse pine": read the compiled script from its new location - #355
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, prefixbmI9Ks46_) out ofpine-facade/translate'sresult.ilTemplate:defvalof the hiddentextinput (the workaround posted in Pine studies fail with "Can't parse pine": pine-facade translate no longer returns ilTemplate #354).result.metaInfo.defaults.inputs.text. Thetextinput'sdefvalis 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.Fix
compiledScriptOf(result)readsresult.ilTemplate, then thetextinput'sdefval, thenmetaInfo.defaults.inputs.text. Only values with the compiled-script prefix are accepted, so a rollback on TradingView's side keeps working.getIndicator()throws a clearPARSE_ERRORwhen no compiled script is found, instead of creating an empty study that fails later on the chart.Verification
tests/unit/indicators.test.ts).npm run typecheck,lint,test(211 passed),build,smoke.BINANCE:BTCUSDT1h:STD;RSIand a privateUSER;…indicator each return 150 periods with this branch. With the published 4.1.0, both fail withCan't parse pine.Fixes #354