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

[Bug?]: yarn create redwood-app fails on node 16.17.0 LTS #6338

Closed
lidermanrony opened this issue Sep 3, 2022 · 10 comments
Closed

[Bug?]: yarn create redwood-app fails on node 16.17.0 LTS #6338

lidermanrony opened this issue Sep 3, 2022 · 10 comments
Assignees
Labels
bug/confirmed We have confirmed this is a bug

Comments

@lidermanrony
Copy link

lidermanrony commented Sep 3, 2022

What's not working?

After testing multiple node versions, the latest version it does work on is 16.4.0

Following the tutorial:
yarn create redwood-app ./redwoodblog

➜  node --version
v16.7.0
➜  yarn --version
1.22.19

getting the following output:

➜  yarn create redwood-app ./redwoodblog

yarn create v1.22.19
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning "create-redwood-app > @redwoodjs/internal > @graphql-codegen/typescript-react-apollo@3.3.2" has unmet peer dependency "graphql-tag@^2.0.0".
warning "create-redwood-app > @redwoodjs/internal > babel-plugin-graphql-tag@3.3.0" has unmet peer dependency "graphql-tag@^2.10.1".
warning "create-redwood-app > @redwoodjs/internal > @redwoodjs/graphql-server > @envelop/depth-limit@1.6.0" has unmet peer dependency "@envelop/core@^2.4.0".
warning "create-redwood-app > @redwoodjs/internal > @redwoodjs/graphql-server > @envelop/disable-introspection@3.4.0" has unmet peer dependency "@envelop/core@^2.4.0".
warning "create-redwood-app > @redwoodjs/internal > @redwoodjs/graphql-server > @envelop/filter-operation-type@3.4.0" has unmet peer dependency "@envelop/core@^2.4.0".
warning "create-redwood-app > @redwoodjs/internal > @redwoodjs/graphql-server > @envelop/parser-cache@4.5.0" has unmet peer dependency "@envelop/core@^2.4.0".
warning "create-redwood-app > @redwoodjs/internal > @redwoodjs/graphql-server > @envelop/validation-cache@4.5.0" has unmet peer dependency "@envelop/core@^2.4.0".
warning "create-redwood-app > @redwoodjs/internal > @graphql-codegen/cli > graphql-config > cosmiconfig-typescript-loader@4.0.0" has unmet peer dependency "@types/node@*".
warning "create-redwood-app > @redwoodjs/internal > @graphql-codegen/cli > graphql-config > cosmiconfig-typescript-loader@4.0.0" has unmet peer dependency "typescript@>=3".
warning "create-redwood-app > @redwoodjs/internal > @graphql-codegen/cli > graphql-config > ts-node@10.9.1" has unmet peer dependency "@types/node@*".
warning "create-redwood-app > @redwoodjs/internal > @graphql-codegen/cli > graphql-config > ts-node@10.9.1" has unmet peer dependency "typescript@>=2.7".
[4/4] 🔨  Building fresh packages...
success Installed "create-redwood-app@2.2.3" with binaries:
      - create-redwood-app
[##########################################################################################################################################################################################################################################] 853/853
  ✔ Creating Redwood app
    ✔ Checking node and yarn compatibility
    ✔ Creating directory '/Users/rony/code/redwoodblog'
  ✔ Installing packages
    ✔ Running 'yarn install'... (This could take a while)
  ✖ Convert TypeScript files to JavaScript
    →     at Module._compile (node:internal/modules/cjs/loader:1101:14)
    Generating types

Error: Command failed with exit code 1: yarn rw ts-to-js
/Users/rony/code/redwoodblog/node_modules/@graphql-yoga/common/node_modules/@whatwg-node/fetch/dist/create-node-ponyfill.js:163
      class Request extends OriginalRequest {
                            ^

TypeError: Class extends value undefined is not a constructor or null
    at createNodePonyfill (/Users/rony/code/redwoodblog/node_modules/@graphql-yoga/common/node_modules/@whatwg-node/fetch/dist/create-node-ponyfill.js:163:29)
    at Object.<anonymous> (/Users/rony/code/redwoodblog/node_modules/@graphql-yoga/common/node_modules/@whatwg-node/fetch/dist/node-ponyfill.js:3:19)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object.<anonymous> (/Users/rony/code/redwoodblog/node_modules/@graphql-yoga/common/cjs/server.js:10:47)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at makeError (/Users/rony/.config/yarn/global/node_modules/execa/lib/error.js:60:11)
    at handlePromise (/Users/rony/.config/yarn/global/node_modules/execa/index.js:118:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  shortMessage: 'Command failed with exit code 1: yarn rw ts-to-js',
  command: 'yarn rw ts-to-js',
  escapedCommand: '"yarn rw ts-to-js"',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: '/Users/rony/code/redwoodblog/node_modules/@graphql-yoga/common/node_modules/@whatwg-node/fetch/dist/create-node-ponyfill.js:163\n' +
    '      class Request extends OriginalRequest {\n' +
    '                            ^\n' +
    '\n' +
    'TypeError: Class extends value undefined is not a constructor or null\n' +
    '    at createNodePonyfill (/Users/rony/code/redwoodblog/node_modules/@graphql-yoga/common/node_modules/@whatwg-node/fetch/dist/create-node-ponyfill.js:163:29)\n' +
    '    at Object.<anonymous> (/Users/rony/code/redwoodblog/node_modules/@graphql-yoga/common/node_modules/@whatwg-node/fetch/dist/node-ponyfill.js:3:19)\n' +
    '    at Module._compile (node:internal/modules/cjs/loader:1101:14)\n' +
    '    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)\n' +
    '    at Module.load (node:internal/modules/cjs/loader:981:32)\n' +
    '    at Function.Module._load (node:internal/modules/cjs/loader:822:12)\n' +
    '    at Module.require (node:internal/modules/cjs/loader:1005:19)\n' +
    '    at require (node:internal/modules/cjs/helpers:94:18)\n' +
    '    at Object.<anonymous> (/Users/rony/code/redwoodblog/node_modules/@graphql-yoga/common/cjs/server.js:10:47)\n' +
    '    at Module._compile (node:internal/modules/cjs/loader:1101:14)',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false,
  context: [Object: null prototype] {}
}

Warning: Directory '/Users/rony/code/redwoodblog' was created. However, the installation could not complete due to an error.

error Command failed.
Exit code: 1
Command: /opt/homebrew/bin/create-redwood-app
Arguments: ./redwoodblog
Directory: /Users/rony/code
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

How do we reproduce the bug?

No response

What's your environment? (If it applies)

seems like the same issue causes `yarn rw info` to fail

➜  redwoodblog yarn rw info
/Users/rony/code/redwoodblog/node_modules/@graphql-yoga/common/node_modules/@whatwg-node/fetch/dist/create-node-ponyfill.js:163
      class Request extends OriginalRequest {
                            ^

TypeError: Class extends value undefined is not a constructor or null
    at createNodePonyfill (/Users/rony/code/redwoodblog/node_modules/@graphql-yoga/common/node_modules/@whatwg-node/fetch/dist/create-node-ponyfill.js:163:29)
    at Object.<anonymous> (/Users/rony/code/redwoodblog/node_modules/@graphql-yoga/common/node_modules/@whatwg-node/fetch/dist/node-ponyfill.js:3:19)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object.<anonymous> (/Users/rony/code/redwoodblog/node_modules/@graphql-yoga/common/cjs/server.js:10:47)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)

When downgrading to 16.4.0 I'm successfully getting the following:

  System:
    OS: macOS 12.5.1
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.4.0 - /private/var/folders/h6/nvt3qzsj1sn9m_klq3t_45hh0000gn/T/xfs-aa3045ab/node
    Yarn: 3.2.1 - /private/var/folders/h6/nvt3qzsj1sn9m_klq3t_45hh0000gn/T/xfs-aa3045ab/yarn
  Databases:
    SQLite: 3.37.0 - /usr/bin/sqlite3
  Browsers:
    Chrome: 105.0.5195.52
    Safari: 15.6.1
  npmPackages:
    @redwoodjs/core: 2.2.3 => 2.2.3


### Are you interested in working on this?

- [ ] I'm interested in working on this
@lidermanrony lidermanrony added the bug/needs-info More information is needed for reproduction label Sep 3, 2022
@jtoar
Copy link
Contributor

jtoar commented Sep 4, 2022

Hey @lidermanrony, I was able to reproduce this using Node.js v16.7.0. Thanks for the detailed issue! We got another report of the same error in a different context on the forums.

It looks like in Node.js 16.7.0, the Request object from undici is undefined for some reason. But it works fine for me on the latest version of Node.js 16. Are you able to upgrade your Node version as a workaround?

@jtoar jtoar assigned jtoar and unassigned noire-munich Sep 4, 2022
@jtoar jtoar added bug/confirmed We have confirmed this is a bug and removed bug/needs-info More information is needed for reproduction labels Sep 4, 2022
@jtoar
Copy link
Contributor

jtoar commented Sep 4, 2022

@lidermanrony rereading your issue, I see you've already tried Node.js 16.4.0 and got it working. But it doesn't work for you on later Node.js 16 versions that are actually LTS? Only versions after v16.13.0 are actually LTS: https://nodejs.org/ru/blog/release/v16.13.0/. But I just tried it on v16.8.0 and it worked. Still looking for a Node.js/undici issue as to why it'd fail on v16.7.0

@chathuraa
Copy link

Hi @jtoar ,

I'm getting the following error.

error create-strapi-app@3.3.2: The engine "node" is incompatible with this module. Expected version ">=10.16.0 <=14.x.x". Got "16.17.0"

thanks,
Chat.

@ajoslin103
Copy link
Contributor

I've seen a few interesting notes out there, hunting for an answer

aws/aws-sdk-js-v3#3389 -- say's multiple versions of dependencies

mike-marcacci/fs-capacitor#16 -- talks about npm force resolutions which we would use as: Selective dependency resolutions https://classic.yarnpkg.com/en/docs/selective-version-resolutions/

I can also confim 16.8.0 works

@ajoslin103
Copy link
Contributor

fwiw 16.16.0 works

@ajoslin103
Copy link
Contributor

I just got hit again...

yesterday things worked & today I have a fastify version complaint - I only trashed my node_modules and yarn.lock

should I never trash my yarn lock again?

I remember when freezing your packages.json became a thing -- we're repeating ourselves !!

(please pretend I posted this at 12:01 :)

@jtoar
Copy link
Contributor

jtoar commented Oct 4, 2022

Sorry for the late response all! @chathuraa could you give more context? Not sure what create-strapi-app is. But the error is basically saying that your version of node is too high.

@ajoslin103 you don't want to rebuild your project's yarn.lock file unless you're just really stuck debugging something and you think it's because of a dependency. Not an expert, but I'm pretty sure yarn.lock is a security mechanism to ensure you get the exact same version of a package every time.

Lastly, leaning towards closing this one. It's definitely broken on the version indicated, but it's quite an odd bug so fixing it seems like it'd take some time, and there's an easy, almost obligatory workaround: use any of the other Node.js v16 versions. Thoughts?

@ajoslin103
Copy link
Contributor

I finally got things working and then got told I couldn't deliver as a docker container as previously promised...

I'm ok closing this one.

@jtoar
Copy link
Contributor

jtoar commented Oct 5, 2022

Will close this one, but @ajoslin103 mind pointing me to the docker container promise? I just spent some time today on one for a fly deploy. There's definitely work to do but in many cases it's possible to get working, albeit the image is still too big.

@jtoar jtoar closed this as completed Oct 5, 2022
@ajoslin103
Copy link
Contributor

@jtoar redwoodjs/docker#66

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/confirmed We have confirmed this is a bug
Projects
Status: Done
Development

No branches or pull requests

5 participants