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

support detect and use corresponding manager and fix windows related error #34

Closed
wants to merge 18 commits into from

Conversation

Yoinky3000
Copy link
Contributor

@Yoinky3000 Yoinky3000 commented Nov 27, 2022

This PR is created to achieve the following things:

  1. Use the package manager that was used in the project to build
  • yarn v2+ without nodeLinker set to node-modules isn't supported since vercel build pipeline doesn't support Plug'n'Play
  1. fix spawn npm ENOENT error occured when running on windows
  2. normalize path when running on windows (back slash to forward slash) so esbuild can identify the path properly

slash normalization changes:

Fixes #52

@Yoinky3000
Copy link
Contributor Author

Seems like support for Route Group cant be achieved by simply add experimentalResponseStreaming detection, so i removed it

@Yoinky3000 Yoinky3000 changed the title Add support for Route Group and detect package manager Add support for auto detect and use corresponding package manager Nov 28, 2022
@LucasLundJensen
Copy link

This PR solved my exact issue.
+1 for merging this into main branch.

For reference, I got the following error:

node:events:505
      throw er; // Unhandled 'error' event
      ^

Error: spawn npm ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:478:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:478:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn npm',
  path: 'npm',
  spawnargs: [ 'install', '-D', 'vercel' ]
}

@changeset-bot
Copy link

changeset-bot bot commented Dec 20, 2022

⚠️ No Changeset found

Latest commit: b063e6f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@danburonline
Copy link

Is this ready to merge?

Copy link

@Cherry Cherry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend you revert the formatting changes. Cloudflare uses tabs in most of its JS/TS projects these days since they're better for accessibility. See cloudflare/workers-sdk#1298 for details.

Adding an .editorconfig and prettier config is a good idea - but I'd grab it from https://github.com/cloudflare/wrangler2 and in another PR.

@Yoinky3000
Copy link
Contributor Author

I would recommend you revert the formatting changes. Cloudflare uses tabs in most of its JS/TS projects these days since they're better for accessibility. See cloudflare/wrangler2#1298 for details.

Adding an .editorconfig and prettier config is a good idea - but I'd grab it from https://github.com/cloudflare/wrangler2 and in another PR.

I have changed the formatting config, same as the config of wrangler2

@Yoinky3000 Yoinky3000 requested a review from Cherry January 17, 2023 02:50
@Yoinky3000 Yoinky3000 changed the title Add support for auto detect and use corresponding package manager support detect and use corresponding manager and fix windows related error Jan 17, 2023
@hanford
Copy link
Contributor

hanford commented Jan 17, 2023

@LOLBRUHNICE how is this different than the PR I opened?

@Yoinky3000
Copy link
Contributor Author

Yoinky3000 commented Jan 17, 2023

@LOLBRUHNICE how is this different than the PR I opened?

First, I noticed that your pr only utilize the package manager when installing vercel, for the building it still use npx, so I created this pr to fully utilize the consumer package manager. Instead of installing vercel, I made it directly use dlx for yarn and pnpm, and use npx for npm(though yarn classic still need to install the vercel first)

Than I noticed that there are also some windows related issue so I also changed some code to solve those problems

@Yoinky3000
Copy link
Contributor Author

so there are differences between your pr and this pr

@nr1brolyfan
Copy link

Would love this to be merged, so I could finally use next-on-pages after a month of waiting #52

@Pavel-Sushko
Copy link

Please merge 🙏🏻

@Cherry Cherry mentioned this pull request Mar 9, 2023
@dario-piotrowicz
Copy link
Member

Hello @LOLBRUHNICE Thank you so very much for this PR, and sorry it hasn't been reviewed in a while 🙇

I am sorry for being a bother but this PR is quite large and broad in scope so it's quite difficult to tackle, moreover it contains some code that goes against changes we applied recently, like the use of package managers: #71 (or the Windows fix that is being addressed by #86)

(I also did open a PR with prettier since by its title and description I didn't think this PR was setting it up: #90)

If it were not too much trouble it would be fantastic if you could remove everything from this PR that isn't specific for point 3 in your description (or close this PR and open a new one if you prefer) 🙏, so that we can land that quickly (if it is too much trouble let me know, and I can apply the change for you here)


Again I am very sorry for this, we've had issues with finding the time to address PRs and some like this haven't gotten the attention they deserved, we're putting a significant effort to improve this and try to reviews PRs from now on much more swiftly.

Also we hope you will continue contributing to the project, if you do, please try to keep PRs smaller and more focused so that they are easier and quicker to review and merge (and other PRs implementing the same changes don't go against it)

@Yoinky3000
Copy link
Contributor Author

Hello @LOLBRUHNICE Thank you so very much for this PR, and sorry it hasn't been reviewed in a while 🙇

I am sorry for being a bother but this PR is quite large and broad in scope so it's quite difficult to tackle, moreover it contains some code that goes against changes we applied recently, like the use of package managers: #71 (or the Windows fix that is being addressed by #86)

(I also did open a PR with prettier since by its title and description I didn't think this PR was setting it up: #90)

If it were not too much trouble it would be fantastic if you could remove everything from this PR that isn't specific for point 3 in your description (or close this PR and open a new one if you prefer) 🙏, so that we can land that quickly (if it is too much trouble let me know, and I can apply the change for you here)


Again I am very sorry for this, we've had issues with finding the time to address PRs and some like this haven't gotten the attention they deserved, we're putting a significant effort to improve this and try to reviews PRs from now on much more swiftly.

Also we hope you will continue contributing to the project, if you do, please try to keep PRs smaller and more focused so that they are easier and quicker to review and merge (and other PRs implementing the same changes don't go against it)

ok, I will create a new pr and try to keep the changes as simple as I can

@dario-piotrowicz
Copy link
Member

@LOLBRUHNICE thank you so very much! sorry about it again 🙇

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.

Error: spawn npm ENOENT
8 participants