Can't resolve '@platformatic/db-ra-data-rest'
See original GitHub issueIn have a project based on react-admin, and I have installed @platformatic/db-ra-data-rest as dependency with command:
yarn add @platformatic/db-ra-data-rest
Starting the project with yarn start
this error occurs on my browser:
Compiled with problems:X
ERROR in ./src/dataProvider.js 3:0-71
Module not found: Error: Can't resolve '@platformatic/db-ra-data-rest' in '/home/ricfio/projects/classifieds-ads/apps/frontend/src'
This is the content of the dataProvider.js
file:
import platformaticDbRestProvider from '@platformatic/db-ra-data-rest'
const apiUrl = 'http://localhost:3042';
const dataProvider = platformaticDbRestProvider(apiUrl);
export default dataProvider;
I have seen that the issue can be solved changing the import as follow:
import platformaticDbRestProvider from '@platformatic/db-ra-data-rest/src/index'
So my questions are:
- Need a index.js file to the root of the package?
@platformatic/db-ra-data-rest/index.js
- Should I built the
@platformatic/db-ra-data-rest
package to generatedist/index.umd.js
referenced in the “main” node ofpackage.json
? - Should
@platformatic/db-ra-data-rest/dist
folder be remove from .gitignore?
How should this issue be solved?
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:13 (13 by maintainers)
Top Results From Across the Web
Platformatics Inc. | IoT Smart Building Solutions
Platformatics enables PoE lighting and other IoT devices. Our technology is simple to use, easy to install, and makes maintenance natural for your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It needs a prepublish script
I released v0.5.1.