Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to resolve entry for package "react-model-view-viewmodel". #14

Closed
Crim opened this issue Dec 3, 2024 · 6 comments
Closed

Failed to resolve entry for package "react-model-view-viewmodel". #14

Crim opened this issue Dec 3, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@Crim
Copy link

Crim commented Dec 3, 2024

Hello!
I'm getting the following error when trying to replicate your examples here: https://codesandbox.io/examples/package/react-model-view-viewmodel

5:49:33 PM [vite] (client) Pre-transform error: Failed to resolve entry for package "react-model-view-viewmodel". The package may have incorrect main/module/exports specified in its package.json.
  Plugin: vite:import-analysis

"use strict";
  3  |  import { ViewModel } from "react-model-view-viewmodel";
     |                             ^
  4  |  export class StaticTextConfigViewModel extends ViewModel {
  5  |    _textValue = "";

Any ideas?

From Package.json:

"dependencies": {
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "react-model-view-viewmodel": "^3.0.0"
  },

Thanks!

@Andrei15193
Copy link
Owner

Hi, thanks for reaching out!

I'll have to check, so far I haven't encountered any issues but I'm most likely missing something 🤔

What setup/tooling are you using?

@Andrei15193 Andrei15193 self-assigned this Dec 3, 2024
@Andrei15193 Andrei15193 added bug Something isn't working question Further information is requested labels Dec 3, 2024
@Crim
Copy link
Author

Crim commented Dec 3, 2024

I'm using a basic out of the box setup using vite.

Thanks!

@Andrei15193
Copy link
Owner

I managed to reproduce the issue even with basic webpack setup. On other setups I also have TypeScript configured which may explain why it works on CodeSandbox.

On further investigation it seems to be related to the module parameter in package.json, I am unsure why I added this in the first place to be honest.

I'll be publishing a fix shortly, just need to run a few more tests.

@Crim
Copy link
Author

Crim commented Dec 3, 2024

awesome thanks! No rush, but appreciate the help.

Excited to dive into this, your docs look great for getting people started with it.

@Andrei15193
Copy link
Owner

Yep, with version 3 I've added a lot more documentation and managed to generate it using typedoc. Everything that is in the API docs is picked from source code and JSdoc comments. There are other goodies with this version that makes it an overall improvement compared to the previous one.

I've published version 3.0.1 with the fix, from what I tested it works with JS-only configs as well as TS configs. I've also updated the samples on CodeSandbox to use the latest version.

If anything comes up, please let me know! Happy coding!

@Andrei15193 Andrei15193 removed the question Further information is requested label Dec 3, 2024
@Crim
Copy link
Author

Crim commented Dec 3, 2024

rad, seems to work, appreciate it!

@Crim Crim closed this as completed Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants