-
Notifications
You must be signed in to change notification settings - Fork 13
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
Incompatibility with next-compose-plugins #68
Comments
Hi @bryg217, thank for this detailed report. It helped me find the issue quickly! I believe it's with For now, can you add const withPlugins = require('next-compose-plugins');
const createNextPluginPreval = require('next-plugin-preval/config');
const withNextPluginPreval = createNextPluginPreval();
// make `withNextPluginPreval` wrap last
module.exports = withNextPluginPreval(
withPlugins([
// ...
])
); |
@ricokahler , I tried out your suggestion and it worked! Thanks for the quick turnaround, wow! Also, glad to hear that the info I provided helped you debug quickly. Lastly, as far as closing the issue, I'll leave it open, and you can decide what to do with it when you're ready. Thanks again. |
@ricokahler for me with compose it worked fine but had the issue described above when trying to access it in _App.tsx SyntaxError: Cannot use import statement outside a module |
@ricokahler I've tried with the starter project, and with just
and i'm still getting Promise{fullfiled} (only if i pass an async function to the preval(), otherwise i get the correct response, so it seems that the issue is the async function(?)) |
Problem
As mentioned in the title, it seems like the default export (i.e.
export default preval(getData())
) is returning the Promisefulfilled
, rather than the actual value resolved.Here's what I see in the console:
So, to get around that, I've been using a hack, which is demonstrated in the mock component snippet below.
Obviously, this is not the right way -- something is off.
I expected it to be:
File Setup/Usage
I actually just started using this library (awesome concept BTW!). Anyway, so here is the proof of concept we are working with.
data.preval.js
next.config.js
_app.js
So in summary: I am basically trying to use the resolved data within
_app.js
.Versioning
node
:12.18.4
next-plugin-preval
:1.2.1
next
:11.1.2
Closing Thoughts
This is my first time using this package, so I may be doing something wrong (e.g. wrong use case).
However, my team and I have tried a few things, and can't seem to wrap our heads around the situation.
So in closing, I hope this was clear, and I'm looking forward to getting to the bottom of this. That way, we could use this awesome package!
All the best.
The text was updated successfully, but these errors were encountered: