-
Notifications
You must be signed in to change notification settings - Fork 82
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
NextJS API route - Unable to load plugin "sqip-plugin-primitive" #318
Comments
Did you try it with plain npm? Looks like you used pnpm? The relevant line is here: https://github.com/axe312ger/sqip/blob/master/packages/sqip/src/sqip.ts#L142 Maybe output the actual error message before the throw and share it here? It might give details whats going wrong on your side? |
I gave up spending more time trying to debug this error. It would have been a "nice to have" but not critical for what I needed. I just wanted to test this package when I found it. But yes, I use Feel free to close this issue if there is not enough information for reproduction |
Really weird. In the end we do a "regular await import" and if that fails, we throw. Not like this is super fancy or rare code. 🤔 I can try to reproduce, when I find time. I never used pnpm, as I am super happy as a yarn v1 fanboy :D |
I've also come across a similar issue while using a demo repository for PayloadJS 3.0. Previously I had managed to use SQIP within the media upload pipeline to generate placeholders using the primitive and svgo. Unfortunately updating to the new pipeline built on Next seems to have issues with finding the plugins within the repository when passing them within the 'onChange' hook as I used before. I'm not sure if I could use an instantiated class of each plugin to pass to output rather than relying on 'await sqip...' to handle the plugins? I'm not super used to using SQIP outside of the provided documentation in the readme. Easy way to reproduce would be to deploy this repository to vercel here: https://github.com/payloadcms/vercel-deploy-payload-postgres Extend the config in Media collection with placeholder:
Upload image and see log in console with unable to find modules and try installing as mentioned above in previous OP comment.
Just want to add that I've been using this plugin for years and really appreciate your work @axe312ger 🥇 might even notice my profile based on SQIP generation 🙇🏼 |
same error after updating node from 16.20 to 20.. |
So strange and annoying that the module resolution is failing so badly. I am happy about any help, I'll try to add official NextJS support later this year For now.. no idea why for some its not working, sorry :/ |
I'm just trying to create a simple route to test sqip which looks really really cool. I had issue with sharp that I fixed updating nextjs webpack config but now I'm facing another error:
I'm using node
v20.9.0
v18.18.2
Here is the
app/sqip/route.ts
file:package.json
and my
next.config.js
The text was updated successfully, but these errors were encountered: