Closed jaypeedevlin closed 3 years ago
Hey there, chiming in with the same issue. 0.19.1 works like a charm, 0.20.0 fails to render in the browser with the same error. I've been over the documentation YAML with a fine toothed comb but haven't found what triggers this yet. Everything else works, it's just the docs site that does not.
Thanks for the report @jaypeedevlin!
If there's a way I can install the unminified JS locally so I can provide you with a more verbose error, I'm willing to help!!
I am decidedly not a front-end developer, but I think the move here is to run the docs site in development mode, which includes source maps that you can leverage in browser. Effectively, that looks like:
git submodule update --init --recursive
, bundle install
, npm install
manifest.json
+ catalog.json
files into the src/
directorymake dev
I'm happy to help out here as well, if you feel comfortable sharing the artifacts privately
Thanks to @JGrubb for sharing some error-prone artifacts! I was able to identify that the error is coming from this line:
This is related to https://github.com/dbt-labs/dbt-docs/pull/183, which moved where the relationships
test appears in the docs site: to
column → from
column. In so doing, it made the (reasonable) assumption that relationships
tests should always have two entries in depends_on.nodes
. In the problematic manifest.json
, I found a relationships
test that has only one entry, for some reason—the to
model only, with the model
model missing—even though both are present in refs
. That's worth a deeper dive, as it may indicate a Core bug.
There's a larger question here, too, about the ideal display for relationships
tests. As https://github.com/dbt-labs/dbt-docs/issues/204 rightly points out, it might be most interesting to display both, and adjust the language in each spot accordingly.
In any case, what we really want is to avoid crashing the entire docs site. I think one immediate fix is to change this: https://github.com/dbt-labs/dbt-docs/blob/ff34ee10b385cf9ce6430ee90a9a05f21c9cc6be/src/app/services/project_service.js#L201
To get the last-indexed item, regardless of whether there's one or two:
var model = depends_on[depends_on.length - 1];
As long as there's some model/source/snapshot/seed that the relationships
test depends on, we should be in good shape.
When I reload the docs site with the same artifacts and that one line changed, everything works perfectly.
Well, I at least found what the cause was from my set of artifacts.
I had some prewritten relationship tests for future models that did not yet exist — I thought I had commented them all out, but I missed one. Commenting that out fixed the issue for me!
~AHA. So, we're using BigQuery and we're using the frontroom/backroom approach where we have our staging models in a totally separate dataset (database). I only have a handful of relationships
tests, and I just found the one here in a backroom model schema def:~
columns:
- name: order_id
description: this is a FK to the parent Order record.
tests:
- not_null
- relationships:
to: ref('accounts_orders') # this should be `stg_accounts_orders`, the backroom model
field: order_id
severity: warn
~I changed that to point to the backroom model and the docs work again (in 0.20.0)~
PEBKAC, was still on 0.19.1, they still fail in 0.20.0 so I'm totally stumped what I have done differently than every other DBT user.
Describe the bug
Upon first loading the docs, I get a javascript error and the docs don't load. Per slack this is happening to at least one other person.
Steps To Reproduce
These are not full reproduction steps — I have a project where this happens on 0.20.0 but also projects where it does not. I'm unable to work out what's unique about the project where this 'bug' happens. This is how to reproduce on the project where it breaks:
dbt docs serve
dbt docs generate
(if I run this command using 0.19.1 the docs load the 0.20.0 generated files without issue)Expected behavior
The docs to load 🙂
Screenshots and log output
The following also appears in my terminal:
The output of
dbt --version
:Additional context
If there's a way I can install the unminified JS locally so I can provide you with a more verbose error, I'm willing to help!!