question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't resolve '@platformatic/db-ra-data-rest'

See original GitHub issue

In 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 generate dist/index.umd.js referenced in the “main” node of package.json ?
  • Should @platformatic/db-ra-data-rest/dist folder be remove from .gitignore?

How should this issue be solved?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
mcollinacommented, Nov 8, 2022

It needs a prepublish script

1reaction
mcollinacommented, Nov 7, 2022

I released v0.5.1.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found