Skip to content
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

Allow newer nextjs patchlevels, to fix problems on some systems #208

Merged
merged 3 commits into from Apr 14, 2021
Merged

Allow newer nextjs patchlevels, to fix problems on some systems #208

merged 3 commits into from Apr 14, 2021

Conversation

egnor
Copy link
Contributor

@egnor egnor commented Apr 10, 2021

Fixes required for yarn install and yarn run dev to work on my system (vanilla Ubuntu 20.04):

  • Allow patchlevel updates of nextjs (10.0.x instead of 10.0.5). On my system, there's an issue in nextjs <10.0.7 with some complicated version interaction that causes sharp's install script to fail to find precompiled binaries for libvips; it tries to compile libvips from source, which doesn't work because expectations about certain header files (glib-object.h) don't match the system layout.

  • Add an explicit (dev) dependency on the same webpack version nextjs uses, due to issues Error: Cannot find module 'webpack' vercel/next.js#21679 (duped with Webpack inlining in Next v10.0.6 breaks treat/webpack-plugin vercel/next.js#21721). The root cause there is somewhat mysterious to me but without the webpack dependency, the dev-server can't generate pages, complaining that NodeTemplatePlugin is missing.

  • The yarn.lock changes that result from the above.

Note, even after these changes, yarn run build doesn't work for me:

Error: Image Optimization using Next.js' default loader is not compatible with `next export`.
  Possible solutions:
    - Use `next start` to run a server, which includes the Image Optimization API.
    - Use any provider which supports Image Optimization (like Vercel).
    - Configure a third-party loader in `next.config.js`.
    - Use the `loader` prop for `next/image`.
  Read more: https://err.sh/next.js/export-image-api
    at /home/egnor/source/BabylonJSDoc/node_modules/next/dist/export/index.js:14:785
    at async Span.traceAsyncFn (/home/egnor/source/BabylonJSDoc/node_modules/next/dist/telemetry/trace/trace.js:5:584)

I'm not sure if the HTML export step is supposed to work? (For local editing, yarn run dev is all you really need.) It seems like doc.babylonjs.com has a "Powered by Vercel" logo; does that mean Vercel is in fact serving the pages and handling the image optimization?

@vercel
Copy link

vercel bot commented Apr 10, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/babylonjs/documentation/7uY6AciSQMD4uSxjsBxrLov3Pbb9
✅ Preview: https://documentation-git-fork-egnor-master-babylonjs.vercel.app

@egnor egnor changed the title Allow upgrading nextjs patchlevels; add an explicit webpack dependency Allow newer nextjs patchlevels, to fix problems on some systems Apr 10, 2021
@RaananW
Copy link
Member

RaananW commented Apr 13, 2021

Thank you so much for that!

next 10.0.6 had a serious issue that prevented us (and many other projects) from building correctly. This is why I am not very keen on using a x version instead of a fixed version we are sure working. I am updating the packages from time to time, I will make sure to update next to the latest asap.

Regarding the build issues with image optimization, I will put this on my todo list. the issue is with server-sided image optimization not available locally. start and dev tasks should work without a problem.

@RaananW RaananW closed this Apr 13, 2021
@RaananW RaananW reopened this Apr 13, 2021
@RaananW
Copy link
Member

RaananW commented Apr 13, 2021

reopening this - would you want to set the fixed version that works for you? I will test the build process and merge it then

@RaananW
Copy link
Member

RaananW commented Apr 13, 2021

To eliminate the second error use yarn run build:local instead of build, this PR added the task - #211

@egnor
Copy link
Contributor Author

egnor commented Apr 13, 2021

Happy to sub in anything 10.0.7 or newer! Do you have a preference between 10.0.7 (the first version that works for me) and 10.0.9 (the latest 10.0.x)?

@RaananW
Copy link
Member

RaananW commented Apr 13, 2021

latest fixed version is fine for me :-)

Thanks!!

…history of issues with nextjs point versions introducing bugs
@egnor
Copy link
Contributor Author

egnor commented Apr 13, 2021

latest fixed version is fine for me :-)

OK! Changed from 10.0.x to 10.0.9, take another look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants