简体   繁体   中英

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

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?

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.

ie 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM