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

is next 12 still supported? #4130

Closed
zenhob opened this issue Apr 17, 2023 · 4 comments
Closed

is next 12 still supported? #4130

zenhob opened this issue Apr 17, 2023 · 4 comments
Labels
kind/bug Something isn't working status/done
Projects

Comments

@zenhob
Copy link

zenhob commented Apr 17, 2023

What is the problem?

I'm getting an error Error: Cannot find module 'next/dist/shared/lib/router/utils/resolve-href' when attempting to build my app with the latest Blitz and Next12. I can trace the error to the changes in this PR: #4108

https://github.com/blitz-js/blitz/pull/4108/files#diff-3b74748c63caaac1b2542d4b5ef07fd982bf01c5c286acf8ac2e9bbfd8637d76R37

The require change here works in Next13 but not Next12. Is Next12 still supported with the latest Blitz?

Paste all your error logs here:

Error: Cannot find module 'next/dist/shared/lib/router/utils/resolve-href'

Paste all relevant code snippets here:

n/a

What are detailed steps to reproduce this?

  1. have a working app that uses blitz and next12
  2. upgrade blitz
  3. observe that the latest blitz and next12 app build fails

Run blitz -v and paste the output here:

Blitz version: 2.0.0-beta.26 (local)
Linux 5.19 | linux-x64 | Node: v16.15.1


 Package manager: npm

  System:
    OS: Linux 5.19 Ubuntu 22.10 22.10 (Kinetic Kudu)
    CPU: (8) x64 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
    Memory: 4.14 GB / 15.31 GB
    Shell: 5.2.2 - /bin/bash
  Binaries:
    Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.15.1/bin/yarn
    npm: 8.16.0 - ~/.nvm/versions/node/v16.15.1/bin/npm
  npmPackages:
    @blitzjs/auth: 2.0.0-beta.26 => 2.0.0-beta.26 
    @blitzjs/next: 2.0.0-beta.26 => 2.0.0-beta.26 
    @blitzjs/rpc: 2.0.0-beta.26 => 2.0.0-beta.26 
    @prisma/client: 3 => 3.15.2 
    blitz: 2.0.0-beta.26 => 2.0.0-beta.26 
    next: 12 => 12.3.4 
    prisma: 3 => 3.15.2 
    react: 18.2.0 => 18.2.0 
    react-dom: 18.2.0 => 18.2.0 
    typescript: 4.5.2 => 4.5.2 

Please include below any other applicable logs and screenshots that show your problem:

No response

@zenhob zenhob added kind/bug Something isn't working status/triage labels Apr 17, 2023
@siddhsuresh
Copy link
Member

Hey @zenhob, thanks for the issue. We should try to make blitz backward compatible to next 12. Do you want to contribute in this fix?

@siddhsuresh siddhsuresh added the status/ready-to-work-on This issue is up for grabs label May 11, 2023
@donmccurdy
Copy link

donmccurdy commented Jun 6, 2023

I'm seeing the same error when trying to start a new Blitz app from scratch with the generator. Steps to reproduce:

  1. yarn global add blitz
  2. blitz new MyProject
  3. cd MyProject
  4. blitz dev

Output:

Error: Cannot find module 'next/dist/shared/lib/router/utils/resolve-href'
Require stack:
- /Users/donmccurdy/Documents/Projects/MyProject/node_modules/@blitzjs/next/dist/index-server.cjs
- /Users/donmccurdy/Documents/Projects/MyProject/next.config.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at mod._resolveFilename (/Users/donmccurdy/Documents/Projects/MyProject/node_modules/next/dist/build/webpack/require-hook.js:23:32)
    at Module._load (node:internal/modules/cjs/loader:841:27)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (/Users/donmccurdy/Documents/Projects/MyProject/node_modules/@blitzjs/next/dist/index-server.cjs:8:21)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/donmccurdy/Documents/Projects/MyProject/node_modules/@blitzjs/next/dist/index-server.cjs',
    '/Users/donmccurdy/Documents/Projects/MyProject/next.config.js'
  ]
}

System details:

Blitz version: 2.0.0-beta.23 (global)
Blitz version: 2.0.0-beta.27 (local)
macOS Ventura | darwin-arm64 | Node: v18.12.1


 Package manager: npm

  System:
    OS: macOS 13.4
    CPU: (8) arm64 Apple M1 Pro
    Memory: 1.21 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.12.1/bin/yarn
    npm: 9.6.7 - ~/.nvm/versions/node/v18.12.1/bin/npm
  npmPackages:
    @blitzjs/auth: 2.0.0-beta.27 => 2.0.0-beta.27
    @blitzjs/next: 2.0.0-beta.27 => 2.0.0-beta.27
    @blitzjs/rpc: 2.0.0-beta.27 => 2.0.0-beta.27
    @prisma/client: 4.6.0 => 4.6.0
    blitz: 2.0.0-beta.27 => 2.0.0-beta.27
    next: 13.1 => 13.1.6
    prisma: 4.6.0 => 4.6.0
    react: 18.2.0 => 18.2.0
    react-dom: 18.2.0 => 18.2.0
    typescript: ^4.8.4 => 4.9.5

EDIT: Sorry, possibly a false alarm. After updating my global blitz version to 2.0.0-beta.27 (from 2.0.0-beta.23) the error disappears.

@SilvanVerhoeven
Copy link

SilvanVerhoeven commented Oct 15, 2023

EDIT: Sorry, possibly a false alarm. After updating my global blitz version to 2.0.0-beta.27 (from 2.0.0-beta.23) the error disappears.

@donmccurdy Could you elaborate on how you did that, please? I am getting the exact same error. Locally, I have installed the latest blitz version (2.0.0-beta.34), but the global version seems stuck at 2.0.0-beta.4 despite running yarn global add blitz@latest.

Blitz version: 2.0.0-beta.4 (global)
Blitz version: 2.0.0-beta.34 (local)
Linux 5.10 | linux-x64 | Node: v18.17.0


 Package manager: npm

  System:
    OS: Linux 5.10 Ubuntu 20.04.6 LTS (Focal Fossa)
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 21.86 GB / 24.85 GB
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 18.17.0 - ~/.nvs/default/bin/node
    Yarn: 1.22.19 - ~/.nvs/default/bin/yarn
    npm: 9.6.7 - ~/.nvs/default/bin/npm
  npmPackages:
    @blitzjs/auth: 2.0.0-beta.34 => 2.0.0-beta.34 
    @blitzjs/next: 2.0.0-beta.34 => 2.0.0-beta.34 
    @blitzjs/rpc: 2.0.0-beta.34 => 2.0.0-beta.34 
    @prisma/client: 4.0.0 => 4.0.0 
    blitz: 2.0.0-beta.34 => 2.0.0-beta.34 
    next: 12.2.5 => 12.2.5 
    prisma: 4.0.0 => 4.0.0 
    react: 18.2.0 => 18.2.0 
    react-dom: 18.2.0 => 18.2.0 
    typescript: ^4.5.3 => 4.9.5

@SilvanVerhoeven
Copy link

Okay, I found my issue. I had nvm and nvs simultaneously installed, and nvm had the blitz binary installed which was used instead of the yarn blitz binary.
I now have the latest blitz binary. For some reason, the error still appears. I an going to open a new issue

@blitzjs-bot blitzjs-bot added status/done and removed status/ready-to-work-on This issue is up for grabs labels Oct 24, 2023
@blitzjs-bot blitzjs-bot added this to Done in Toolkit Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working status/done
Projects
Development

No branches or pull requests

6 participants