Skip to content

docs: address yarn link setup error

Tristan Read requested to merge tr-gitlab-ui-yarn-link into master

When you use yarn to link gitlab-ui to gitlab-ce, you get the following error in the gdk logs, and pages that import chart.js fail to load:

17:09:19 webpack.1               | ERROR in /<path-to-checked-out-gitlab-ui>/dist/charts.js
17:09:19 webpack.1               | Module not found: Error: Can't resolve '@gitlab/ui' in '/<path-to-checked-out-gitlab-ui>/dist'

The error occurs because the bundled dist/charts.js contains this line: import { GlPopover } from '@gitlab/ui';

To fix this, you must also yarn link your local gitlab-ui to itself (). The changeset in this MR details such a workaround in the setup docs.

Point for discussion: I wonder if we are bundling charts.js correctly. Is the intention to be able to import it independently? In that case I would guess it should not import @gitlab/ui.

Edited by Tristan Read

Merge request reports

Loading