lucid
lucid copied to clipboard
feat(Next.JS): Support server-side Next.JS usage
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: https://github.com/spacebudz/lucid/issues/174
[ Testing: deno task build ]
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?
@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.