Sharing files among different folders in kibana 7.10.2

Hi Team,
I had created a new file inside src\core\server\core_app\refresh_service.ts
and trying to access it at src\plugins\data\public\ui\search_bar\search_bar.tsx

I am getting linting errors, even I am not able to build it.

Error :
Module not found: Error: Can't resolve 'src/core/server/core_app/refresh_service' in 'D:\kibana_discussion\kibana\src\plugins\data\public\ui\search_bar'

How I can share files between different folders in kibana

Basically, i want to share data between core and plugin folder by a service.

You need to use the relative notation for anything but types: ../../../../../core/(and so on)

Something else I noticed: You try to import server code on the client (server vs public) - this normally doesn't make sense. If your logic is intended to be used both on the server and the client, move them to a common folder outside of public and server, then import from there from both places, otherwise just move them to either public or server depending on where it's going to be used

Thanks, @flash1293
Yes, it should be a relative path.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.