Skip to the content

Reference

Troubleshooting

The usual problems, and the checks that find them, in order. Most come down to an address that doesn't match a key, a missing height, or a content security policy.

Start with the browser's developer tools: the Console for errors, and the Network tab for the editor's requests (grant and export on your route in strict mode, or api.dorvyn.dev with a key in the page).

Nothing shows#

The editor's box is there, but empty or zero-height.

  1. Give it a height. The editor fills its box: style="display: block; height: 100vh", or flex: 1 in a flex column. In a layout of your own, <dorvyn-document> needs a size too.
  2. The elements aren't registered. With plain HTML, import "@dorvyn/elements/define" must run. In Vue, tell the compiler dorvyn-* tags are custom elements (HTML). In Angular, add CUSTOM_ELEMENTS_SCHEMA.
  3. It never started. It starts once it has a license or a server-url. Check one of them is set, not empty.
  4. Hidden at start. An editor inside a closed tab or modal may measure zero. Keep its container a real size, or create the editor when it's first shown.

The editor never becomes editable#

It shows, but stays read-only. Check editor.state.get() in the console (await document.querySelector("dorvyn-editor").whenReady() gives you the editor), or the full editor's status bar.

engine is "failed":

  • The Console shows a CSP error: add 'wasm-unsafe-eval' to script-src and the CDN to connect-src (Content security policy).
  • A firewall or proxy blocks cdn.dorvyn.dev: allow it, or serve the engine yourself.
  • "The engine didn't match this SDK": you serve an engine from another version, or a proxy rewrites the file. Download the engine for the SDK version you installed, and serve it unchanged.

license is "unavailable":

  • Strict mode: open the Network tab and find grant.
    • No request at all: server-url isn't set, or the page has a license too (the key wins).
    • 401 Sign in to edit.: your user function returns nothing. Log what it sees.
    • 404: the route isn't mounted at …/:action, or server-url has a typo. server-url is the path without /grant.
    • 500: read your server's log. Usually DORVYN_SECRET_KEY isn't set in that environment, or the server can't reach Dorvyn.
    • 401 This key can't be used here.: see that message.
  • A key in the page: the request to api.dorvyn.dev answers with the reason. Usually the address isn't listed on the key exactly, a live key on localhost, or the plan isn't active.

license is "refused": the page is served at another address than the license was made for. A reverse proxy or CDN may be rewriting the host. Make sure the browser's address is the one on the key.

readOnly is true but license is "valid": the person chose Viewing. Switch back to Editing in the sidebar (or editor.commands.run("viewing", false)).

It works locally but not in production#

  1. Live keys. Production uses live keys: a live secret key in the server's environment, and a live publishable key listing the production address.
  2. The address. https://app.example.com and https://www.example.com are different. List each one the editor runs on.
  3. The environment variable. DORVYN_SECRET_KEY is set in production's environment (not just .env.local), and the server was restarted or redeployed after.
  4. The plan. Live keys need an active plan.
  5. CSP. Production often has a content security policy that development doesn't.
  6. Body size. A proxy or framework limit on request bodies (often 1 MB) blocks saving larger documents. Raise it for the route.

Saving as Word fails#

  • "The license service can't be reached": wait, or save to your own storage meanwhile. Editing is safe.
  • 413 or a proxy error on export: your server or a proxy limits request bodies. Raise it for the route.
  • "The plan's exports for today are used up": your daily limit; it resets at midnight UTC.
  • "The document is larger than the plan allows": make pictures smaller.
  • Strict mode, a 5xx on export: your server's log has the details.

Every message is explained in Messages and errors.

Editing stops after a while#

  • After about 10 minutes, then comes back: a renewal failed and then succeeded. Check your route's error rate.
  • When the person signs out of your app: as intended. Editing stops at the next renewal.
  • After a laptop sleeps: the license lapsed meanwhile. It renews within seconds of the connection returning, without a reload.
  • Every day at the same time: your server's session expires. The editor needs the person signed in while it renews.

Drafts don't come back#

  • autosave-key must be set, and the same on the next visit.
  • Private windows forget everything when closed.
  • Another document's editor with the same key may have replaced it: use one key per document.
  • state.saveStatus is "toolarge": the browser has no room for it. Free space, or save the document yourself.

The page's styles change the document#

They shouldn't: the editor resets what pages commonly set on every element inside the document. Rules marked !important, or with two ids or more, still win. Keep those away from dorvyn-document (Theming and branding).

Keyboard shortcuts don't work#

  • Your app may capture the same keys (Ctrl+K for its own search, say) before the editor. Stop your handler when the focus is inside dorvyn-editor.
  • With several editors on one page, shortcuts go to the one that has the focus.

Still stuck?#

Collect what support will ask for, and you'll get an answer much sooner:

  • the SDK version (npm ls @dorvyn/elements), browser and OS;
  • what editor.state.get() shows for engine and license;
  • the grant or export request's status and answer from the Network tab (never the full request or your keys);
  • your server's log line, if any;
  • the time it happened, with your time zone.

Then email support@dorvyn.dev from your work address, with your organization's name. Never send a secret key to anyone, including Dorvyn.