Angular 13 migration : Schema validation failed with the following errors: Data path "/error" must be string

Viewed 136

I am working on migrating from angular 8 to 13. I followed the guidelines from https://update.angular.io/ but I keep getting this error when trying to build most of my custom libraries from my application root folder :

āœ– Compiling with Angular sources in Ivy partial compilation mode.
Schema validation failed with the following errors:
  Data path "/error" must be string.

Some libraries are working but some not, and I can't figure out why.

Do you know what this kind of messages mean ?

Is there a way to get more logs than this message ?

1 Answers

This is most likely caused by the way you imported custom libraries within each other.

For example.

If you have my-lib-a, my-lib-b and my-lib-c. And any of these libraries import a component or modal from the other library, the import MUST be an absolute import and not relatively imported.

i.e If you want to import a component from my-lib-a into my-lib-b

then the import must be lib/my-lib-a/<imported component name>

and not ../../my-lib-a/<imported component name>

I'd suggest you use import alias to make this much easier to handle so you'd have something like

import Component from '@my-lib-a/componentName'

You can configure this in you tsconfig.json file.

I hope this helps

Related