-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
feat(Next.JS): Support server-side Next.JS usage #220
base: main
Are you sure you want to change the base?
Conversation
Hold on this is now not working... it was before. Investigating. |
@alessandrokonrad this change works when I build it off of 0.9.8 (as you recommended in the original ticket), but not off of 0.10.7. Any reason why that would be? How do you want to address this, publishing an npm patch called 0.9.8-nextjs? |
Next.JS disallows relative imports since 12.0.1 (see https://nextjs.org/docs/messages/middleware-relative-urls for more information). So, we need to sniff out if we are in the NEXTJS environment and if so, use the fallback URL. This should resolve: spacebudz#174 [ Testing: deno task build ]
0a61e5b
to
a125e98
Compare
@thaddeusdiamond Followup on this PR, tested this PR in a test/production app and works as indended. Would strongly recommend this gets merged, otherwise other next users will fall into the rabbit hole of why certain .wasm functions break and its tricky to debug without going into the module code. Next is now more heavily server-side than before so I expect more users to run into this issue. |
Merge Latest Conway Changes
Ideally we would want to use the paradigm that the build process set out to pull from a local lib, but we can't for NextJS. Since this is a fork, we don't need to worry about a circular dependency (the fork will pull from the main). Without this, NextJS splits the libraries into chunks and the path resolution fails. [ Testing: npm i lucid-cardano-nextjs@0.10.10-b4 ]
712aeeb
to
e13f382
Compare
Next.JS disallows relative imports since 12.0.1 (see https://nextjs.org/docs/messages/middleware-relative-urls for more information). So, we need to sniff out if we are in the NEXTJS environment and if so, use the fallback URL.
This should resolve:
#174
[ Testing: deno task build ]