-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 11.4.0 with next 10.0.7 version next.config not being used #4990
Nextjs 11.4.0 with next 10.0.7 version next.config not being used #4990
Comments
I am also facing the same issue. |
@FrozenPandaz Any news on this? This is important and seems that happen after upgrading to the latest versions as you suggested among CLI and others |
@FrozenPandaz Just a small info that might help, so if you use 10.0.8 (which i assume the 11.4.0 of nrwl next has upgraded) they have a bug which don't allow builds, you can read that on the issue i have raised in nextjs repo so it will probably require a rollback Another note that i have found is that after the nrwl/next export command is executed it uses next/export and it does correctly but after when it tries to ls stat or even check for the routes.manifest, check that it isn't going on the right path
So the serveless folder is not even created and so the files are obviously not found but i'm not sure if this is really related with Nextjs or not, exports are simply throwing this |
Hey @underfisk , thanks for reporting the issue! I took a stab at recreating your issue in this repo here. More specifically, here's a commit with all the changes that I had to do on top of a clean nx workspace (version 11.4.0) You have outlined a few issues:
Let us know how it goes! |
@kirjai Thanks for recreating the issue, so i'll answer to each point
|
I went a step further in my repo, and added a realistic image to confirm that everything works as expected. Here's a commit. Only this variation of values works. Adding Could the
|
@kirjai Yes the env vars are okay so locally i would have to setup .local.env or .env because most i use as arguments directly on the script command The issue was i had next as "next": "^10.0.7" and somehow if you say "^" its going to install the latest and it was creating some kind of conflict and so doing "next": "10.0.7" (using the exact version) it started to only installing that version (I'm using pnpm not yarn or npm) |
thanks for the update! so hopefully the upcoming version of Nx will solve all of these problems and allow you to use latest Nx and Next (10.0.9) together 🤞 |
version |
I'm still on 11.5.2 but will upgrade soon. I also ran into the image domain issue. My domains were perfectly set. In fact, it worked before migrating this same project (with exact same domains and same image urls in db) over to nx. Removing the @kirjai there is definitely something in that webpack config breaking it |
@kirjai |
@cyrus-za i'm afraid i'm going to need a repro to be able to look into it properly, as mentioned in my previous comment, i couldn't recreate the domains issue given the repro steps in the original post. Same for the pages-manifest.json, i'm afraid. |
@kirjai here's a repro: https://github.com/cyrus-za/nx-repro-4990-next-babel-issues
> nx run next-app:build
info - Using webpack 4. Reason: future.webpack5 option not enabled https://nextjs.org/docs/messages/webpack5
info - Using webpack 4. Reason: future.webpack5 option not enabled https://nextjs.org/docs/messages/webpack5
info - Checking validity of types
info - Using external babel configuration from org/babel.config.json
info - Using external babel configuration from org/apps/next-app/.babelrc
info - Using external babel configuration from org/libs/ui/.babelrc
info - Creating an optimized production build
Failed to compile.
org/libs/ui/src/lib/Dropdown.tsx 68:49
Module parse failed: Unexpected token (68:49)
File was processed with these loaders:
* ../../node_modules/.pnpm/next@10.1.3_19437c2f9b137c4ee9c416360487a7aa/node_modules/next/dist/build/webpack/loaders/next-babel-loader.js
You may need an additional loader to handle the result of these loaders.
| }) => {
| const [isOpen, setOpen] = useState(false);
> const [key, selectKey] = useState(selectedKey ?? defaultKey);
| const values = options.map(({
| key,
> Build failed because of webpack errors
ERROR Command failed with exit code 1. This is what I got when upgrading to 11.6.1 11.5.2 had the image issue discussed above. |
I can confirm that this is still broken in nx 12 |
I noticed my package.json had This appeared to be fixing it but a lot of other things also changed in the lockfile, so I tried to manually remove changes in the lockfile to pin it down to what caused it. Locally it was fixed by simply making the ts changes, but when I pushed it wasn't fixed yet. I removed my node modules and reinstalled, still worked locally without any git changes. So I killed the loclfile and the node_modules and did a force pnpm install and then got some new lockfile changes. I committed that and then the build in github actions worked, but not on vercel deployment and also not on master/main. Something is very strange with how it gets decided when to install what, despite a frozen lockfile. I tried switching to npm, but same result. |
We'll get this patched up, in the meantime you can update your lib's
The |
@cyrus-za this was released in |
I updated to 12.0.2 and still got the same error. I also tried switching the .babelrc file in the repro and it still fails as seen here: cyrus-za/nx-repro-4990-next-babel-issues#7 Please reopen the issue |
Also, for some reason
@jaysoo you said
I am using node 14 in all my environments (local, github actions, vercel) |
@cyrus-za I updated to Nx 12.0.3 and the app loads for me (including loading the config). https://github.com/jaysoo/nx-repro-4990-next-babel-issues Can you let me know if there's still an issue for you?
The problem wasn't with the runtime environment, it was webpack not understanding the syntax properly. |
yeah, upgrading to One thing to note, that you sometimes might need to clear |
Updating to 12.0.3 fixes the issue of not understanding ts 3.7+ syntax. After that got solveed, I can confirm that the domain image issue is also gone.
|
@cyrus-za I've answered your caching question in the other issue you opened |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Right now i'm having issues with Vercel deploy due to the routes manifest but locally now nextjs config is not being used because i do use next/image component and it requires image domains and i have set all the domains and it doesn't recognize, NOR env variables so i assume the file is not being used
Nx each time i upgrade i do have issues and breaking changes or something does stop working, i'm not sure what happened but in fact next.config is not being process correctly
Expected Behavior
Load the file correctly, allow me to process a build and have all my env vars and image domains correctly
Steps to Reproduce
Simply install all latest versions except nextjs (use 10.0.7) and use Nextjs image component or even try to pass env variables
My next.config.js:
This issue may not be prioritized if details are not provided to help us reproduce the issue.
Failure Logs
in vercel I do have one
Now locally I have the fact that it does not load images throwing
If i do print the process env, its empty even though i'm passing variables
Environment
Node : 14.15.5
OS : darwin x64
pnpm : 5.18.3
nx : 11.2.12
@nrwl/angular : Not Found
@nrwl/cli : 11.4.0
@nrwl/cypress : Not Found
@nrwl/devkit : Not Found
@nrwl/eslint-plugin-nx : 11.4.0
@nrwl/express : Not Found
@nrwl/jest : 11.4.0
@nrwl/linter : 11.4.0
@nrwl/nest : 11.4.0
@nrwl/next : 11.4.0
@nrwl/node : 11.4.0
@nrwl/react : 11.4.0
@nrwl/schematics : Not Found
@nrwl/tao : 11.4.0
@nrwl/web : 11.4.0
@nrwl/workspace : 11.4.0
typescript : 4.0.7
The text was updated successfully, but these errors were encountered: