auto-animate
auto-animate copied to clipboard
Package path ./react is not exported from package
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.
What build tool are you using?
Webpack
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']
Thanks for the heads up @markgaze
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.
Cross posted to Remix here https://github.com/remix-run/remix/issues/4186
have the same issue on vue app
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']
).
I'm experiencing the same issue on NextJS, anybody got a fix suggestion?
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.