Title: fix(emcn): keep Prism grammar registrations in bundle, never throw on missing grammar by waleedlatif1 · Pull Request #5293 · simstudioai/sim · GitHub
Open Graph Title: fix(emcn): keep Prism grammar registrations in bundle, never throw on missing grammar by waleedlatif1 · Pull Request #5293 · simstudioai/sim
X Title: fix(emcn): keep Prism grammar registrations in bundle, never throw on missing grammar by waleedlatif1 · Pull Request #5293 · simstudioai/sim
Description: Summary Selecting files in the start block's input format (file[] field) crashed immediately with The language "json" has no grammar. — and the same crash was latent in every other workflow-editor code highlighter (subflow editor, condition input, code blocks, tool-input editor, variables JSON editor). Root cause: consumers import { highlight, languages } from the @sim/emcn barrel, which re-exported Prism's highlight straight from prismjs. Bundlers resolved that passthrough directly from prismjs and skipped prism.ts's module body — dropping the side-effect grammar registrations, so languages.json (etc.) were undefined at runtime and Prism threw. Fix is centralized at the source: prism.ts now owns highlight as a local wrapper, so the grammar registrations stay in the dependency graph, and the wrapper degrades to escaped plaintext when a grammar is missing instead of throwing. No per-file imports or inline guards — one change covers all consumers. Type of Change Bug fix Testing Tested manually — start-block file[] field and other workflow-editor editors no longer crash; tsc clean across @sim/emcn and apps/sim. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Summary Selecting files in the start block's input format (file[] field) crashed immediately with The language "json" has no grammar. — and the same crash was latent in every other w...
X Description: Summary Selecting files in the start block's input format (file[] field) crashed immediately with The language "json" has no grammar. — and the same crash was latent in e...
Opengraph URL: https://github.com/simstudioai/sim/pull/5293
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ea89d8fb-dc7d-71a4-c351-e5f402f01516 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 955E:BD772:548178:74BC1A:6AFB3C77 |
| html-safe-nonce | e9796f96b847295dc99480e8cdc8f27723fa8c23aa11c73877403029d8910239 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTVFOkJENzcyOjU0ODE3ODo3NEJDMUE6NkFGQjNDNzciLCJ2aXNpdG9yX2lkIjoiMTc3NDc0NDcxOTczNzk2MTU5MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b863cd465637d6501317577ac921075a2202bc580bfe0c843c9baaa0d26ee34b |
| hovercard-subject-tag | pull_request:3965967197 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5293/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary Selecting files in the start block's input format (file[] field) crashed immediately with The language "json" has no grammar. — and the same crash was latent in every other w... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2169b0dfbef67ed6b128074a5ed45bb7d5d1859783b10178b09a7765ad5f3693 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b4fc8df5ef1c6757e733a23e6b81b6725021823 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width