auto-animate icon indicating copy to clipboard operation
auto-animate copied to clipboard

Package path ./react is not exported from package

Open HZSamir opened this issue 2 years ago • 6 comments

Hello, installing this package then importing it in my project throws the following error: Module not found: Error: Package path ./react is not exported from package C:\Users\Mak\Sites\Tests\erb-4.0.1-qms\node_modules\@formkit\auto-animate (see exports field in C:\Users\Mak\Sites\Tests\erb-4.0.1-qms\node_modules\@formkit\auto-animate\package.json)

How to fix it? Thank you.

HZSamir avatar May 22 '22 08:05 HZSamir

What build tool are you using?

justin-schroeder avatar May 23 '22 02:05 justin-schroeder

Webpack

HZSamir avatar May 23 '22 10:05 HZSamir

I had this on a Remix app, I had to add the following to my remix.config.js config file to make it work:

serverDependenciesToBundle: ['@formkit/auto-animate/react']

markgaze avatar May 23 '22 16:05 markgaze

Thanks for the heads up @markgaze

justin-schroeder avatar May 23 '22 16:05 justin-schroeder

I still get an error message even after adding this to the serverDependenciesToBundle

The path "@formkit/auto-animate" is imported in app/routes/index.tsx but "@formkit/auto-animate" was not found in your node_modules. Did you forget to install it?

I do have it installed in the package.json

"@formkit/auto-animate": "^1.0.0-beta.3",

I also noticed that when I tried to create a reproduction of this using create react app or a vite app everything works fine out of the box, but when creating a Remix app I can't get it to build without this error.

Reproduction here https://github.com/Rooted-Software/remix-auto-animate-reproduction

I am going cross post this in the Remix repo as well.

rootedsoftware avatar Sep 13 '22 22:09 rootedsoftware

Cross posted to Remix here https://github.com/remix-run/remix/issues/4186

rootedsoftware avatar Sep 13 '22 22:09 rootedsoftware

have the same issue on vue app

ijcnvv avatar Oct 31 '22 11:10 ijcnvv

I still get an error message even after adding this to the serverDependenciesToBundle

The path "@formkit/auto-animate" is imported in app/routes/index.tsx but "@formkit/auto-animate" was not found in your node_modules. Did you forget to install it?

I do have it installed in the package.json

"@formkit/auto-animate": "^1.0.0-beta.3",

I also noticed that when I tried to create a reproduction of this using create react app or a vite app everything works fine out of the box, but when creating a Remix app I can't get it to build without this error.

Reproduction here https://github.com/Rooted-Software/remix-auto-animate-reproduction

I am going cross post this in the Remix repo as well.

Im getting the same error, but hey it works now (using serverDependenciesToBundle: ['@formkit/auto-animate/react']).

gomflo avatar Nov 02 '22 18:11 gomflo

I'm experiencing the same issue on NextJS, anybody got a fix suggestion?

melvinalmonte avatar Nov 06 '22 03:11 melvinalmonte

Adding serverDependenciesToBundle: ['@formkit/auto-animate/react'] fixed it for me, but I had to delete the /build and /public/build folders first so remix watch could regenerate the server files.

austins avatar Nov 11 '22 23:11 austins