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

[Windows] template not working #10813

Open
NeilRiver opened this issue Jan 26, 2025 · 6 comments · May be fixed by #10830
Open

[Windows] template not working #10813

NeilRiver opened this issue Jan 26, 2025 · 6 comments · May be fixed by #10830
Assignees
Labels
create-payload-app status: needs-triage Possible bug which hasn't been reproduced yet

Comments

@NeilRiver
Copy link

Describe the Bug

I'll start with a question

You have a separate repository "website" and an example "website", which of the two "websites" is worth it and which one should I take?
https://github.com/payloadcms/payload/tree/main/templates/website
https://github.com/payloadcms/website

and another question, why is there a different installer in different examples (yes, I know that I can use any one)?

pnpm install && pnpm dev to install dependencies and start the dev server
Run yarn dev

and now to the problem


I followed this link https://github.com/payloadcms/payload/tree/main/templates/website#clone

and followed the steps indicated there

  1. pnpx create-payload-app my-project -t website
  2. cd my-project && cp .env.example .env
  3. pnpm install && pnpm dev

and here is also an interesting point... in the documentation you say installation is required, but pnpm says no.

◇   Next Steps
│
│
│  Launch Application:
│
│    - cd ./my-project
│    - pnpm dev or follow directions in README.md

Okay, we're done with the contradictions in the documentation, let's move on.
and here we learn that the template cannot be installed and executed without unnecessary manipulations. I suppose it should not be so.

PS C:\Users\user\Desktop\my-project> pnpm dev

> [email protected] dev C:\Users\user\Desktop\my-project
> cross-env NODE_OPTIONS=--no-deprecation next dev

   ▲ Next.js 15.1.6
   - Local:        http://localhost:3000
   - Network:      http://192.168.0.103:3000
   - Environments: .env
   - Experiments (use with caution):
     · turbo

 ✓ Starting...
 ✓ Ready in 2.3s
 ○ Compiling /_not-found ...
 ✓ Compiled /_not-found in 3.2s (551 modules)
 ⚠ Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
 GET /_next/static/webpack/bd097caf998bd95a.webpack.hot-update.json 404 in 4334ms
 ○ Compiling / ...
 ✓ Compiled / in 8.8s (3682 modules)
 ⨯ Error:
Something went wrong installing the "sharp" module

Cannot find module '../build/Release/sharp-win32-x64.node'
Require stack:
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected]\node_modules\sharp\lib\sharp.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected]\node_modules\sharp\lib\constructor.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected]\node_modules\sharp\lib\index.js
- C:\Users\user\Desktop\my-project\.next\server\app\(frontend)\page.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\server\require.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\server\load-components.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\build\utils.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\build\swc\options.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\build\swc\index.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\build\analysis\parse-module.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\build\analysis\get-page-static-info.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\server\lib\router-utils\setup-dev-bundler.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\server\lib\router-server.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\server\lib\start-server.js

Possible solutions:
- Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"
- Install for the current win32-x64 runtime: "npm install --platform=win32 --arch=x64 sharp"
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
    at Object.sharp (C:\Users\user\Desktop\my-project\.next\server\app\(frontend)\page.js:77:18)
    at __webpack_require__ (C:\Users\user\Desktop\my-project\.next\server\webpack-runtime.js:33:43)
    at eval (webpack-internal:///(rsc)/./src/payload.config.ts:6:63)
    at (rsc)/./src/payload.config.ts (C:\Users\user\Desktop\my-project\.next\server\app\(frontend)\page.js:2058:1)
    at __webpack_require__ (C:\Users\user\Desktop\my-project\.next\server\webpack-runtime.js:33:43)
    at eval (webpack-internal:///(rsc)/./src/utilities/getGlobals.ts:5:73)
    at (rsc)/./src/utilities/getGlobals.ts (C:\Users\user\Desktop\my-project\.next\server\app\(frontend)\page.js:2266:1)
    at __webpack_require__ (C:\Users\user\Desktop\my-project\.next\server\webpack-runtime.js:33:43)
    at eval (webpack-internal:///(rsc)/./src/Footer/Component.tsx:7:79)
    at (rsc)/./src/Footer/Component.tsx (C:\Users\user\Desktop\my-project\.next\server\app\(frontend)\page.js:1243:1)
    at __webpack_require__ (C:\Users\user\Desktop\my-project\.next\server\webpack-runtime.js:33:43)
    at eval (webpack-internal:///(rsc)/./src/app/(frontend)/layout.tsx:14:75)
    at (rsc)/./src/app/(frontend)/layout.tsx (C:\Users\user\Desktop\my-project\.next\server\app\(frontend)\page.js:1398:1)
    at Function.__webpack_require__ (C:\Users\user\Desktop\my-project\.next\server\webpack-runtime.js:33:43) {
  page: '/'
}
 ○ Compiling /_error ...
 GET / 500 in 12421ms
 ✓ Compiled /_error in 3.9s (3910 modules)
 ⚠ Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
 GET /_next/static/webpack/bd097caf998bd95a.webpack.hot-update.json 404 in 4081ms
 ⨯ Error:
Something went wrong installing the "sharp" module

Cannot find module '../build/Release/sharp-win32-x64.node'
Require stack:
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected]\node_modules\sharp\lib\sharp.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected]\node_modules\sharp\lib\constructor.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected]\node_modules\sharp\lib\index.js
- C:\Users\user\Desktop\my-project\.next\server\app\(frontend)\page.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\server\require.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\server\load-components.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\build\utils.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\build\swc\options.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\build\swc\index.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\build\analysis\parse-module.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\build\analysis\get-page-static-info.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\server\lib\router-utils\setup-dev-bundler.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\server\lib\router-server.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\server\lib\start-server.js

Possible solutions:
- Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"
- Install for the current win32-x64 runtime: "npm install --platform=win32 --arch=x64 sharp"
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
    at Object.sharp (C:\Users\user\Desktop\my-project\.next\server\app\(frontend)\page.js:77:18)
    at __webpack_require__ (C:\Users\user\Desktop\my-project\.next\server\webpack-runtime.js:33:43)
    at eval (webpack-internal:///(rsc)/./src/payload.config.ts:6:63)
    at (rsc)/./src/payload.config.ts (C:\Users\user\Desktop\my-project\.next\server\app\(frontend)\page.js:2058:1)
    at __webpack_require__ (C:\Users\user\Desktop\my-project\.next\server\webpack-runtime.js:33:43)
    at eval (webpack-internal:///(rsc)/./src/utilities/getGlobals.ts:5:73)
    at (rsc)/./src/utilities/getGlobals.ts (C:\Users\user\Desktop\my-project\.next\server\app\(frontend)\page.js:2266:1)
    at __webpack_require__ (C:\Users\user\Desktop\my-project\.next\server\webpack-runtime.js:33:43)
    at eval (webpack-internal:///(rsc)/./src/Footer/Component.tsx:7:79)
    at (rsc)/./src/Footer/Component.tsx (C:\Users\user\Desktop\my-project\.next\server\app\(frontend)\page.js:1243:1)
    at __webpack_require__ (C:\Users\user\Desktop\my-project\.next\server\webpack-runtime.js:33:43)
    at eval (webpack-internal:///(rsc)/./src/app/(frontend)/layout.tsx:14:75)
    at (rsc)/./src/app/(frontend)/layout.tsx (C:\Users\user\Desktop\my-project\.next\server\app\(frontend)\page.js:1398:1)
    at Function.__webpack_require__ (C:\Users\user\Desktop\my-project\.next\server\webpack-runtime.js:33:43) {
  page: '/'
}
 ⨯ Error:
Something went wrong installing the "sharp" module

Cannot find module '../build/Release/sharp-win32-x64.node'
Require stack:
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected]\node_modules\sharp\lib\sharp.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected]\node_modules\sharp\lib\constructor.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected]\node_modules\sharp\lib\index.js
- C:\Users\user\Desktop\my-project\.next\server\app\(frontend)\page.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\server\require.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\server\load-components.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\build\utils.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\build\swc\options.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\build\swc\index.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\build\analysis\parse-module.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\build\analysis\get-page-static-info.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\server\lib\router-utils\setup-dev-bundler.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\server\lib\router-server.js
- C:\Users\user\Desktop\my-project\node_modules\.pnpm\[email protected][email protected]._531a6c0760ab0e712c29e63f22e59623\node_modules\next\dist\server\lib\start-server.js

Possible solutions:
- Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"
- Install for the current win32-x64 runtime: "npm install --platform=win32 --arch=x64 sharp"
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
    at Object.sharp (C:\Users\user\Desktop\my-project\.next\server\app\(frontend)\page.js:77:18)
    at __webpack_require__ (C:\Users\user\Desktop\my-project\.next\server\webpack-runtime.js:33:43)
    at eval (webpack-internal:///(rsc)/./src/payload.config.ts:6:63)
    at (rsc)/./src/payload.config.ts (C:\Users\user\Desktop\my-project\.next\server\app\(frontend)\page.js:2058:1)
    at __webpack_require__ (C:\Users\user\Desktop\my-project\.next\server\webpack-runtime.js:33:43)
    at eval (webpack-internal:///(rsc)/./src/utilities/getGlobals.ts:5:73)
    at (rsc)/./src/utilities/getGlobals.ts (C:\Users\user\Desktop\my-project\.next\server\app\(frontend)\page.js:2266:1)
    at __webpack_require__ (C:\Users\user\Desktop\my-project\.next\server\webpack-runtime.js:33:43)
    at eval (webpack-internal:///(rsc)/./src/Footer/Component.tsx:7:79)
    at (rsc)/./src/Footer/Component.tsx (C:\Users\user\Desktop\my-project\.next\server\app\(frontend)\page.js:1243:1)
    at __webpack_require__ (C:\Users\user\Desktop\my-project\.next\server\webpack-runtime.js:33:43)
    at eval (webpack-internal:///(rsc)/./src/app/(frontend)/layout.tsx:14:75)
    at (rsc)/./src/app/(frontend)/layout.tsx (C:\Users\user\Desktop\my-project\.next\server\app\(frontend)\page.js:1398:1)
    at Function.__webpack_require__ (C:\Users\user\Desktop\my-project\.next\server\webpack-runtime.js:33:43) {
  page: '/'
}
 GET / 500 in 1503ms

Link to the code that reproduces this issue

what code ? run your template on windows pc

Reproduction Steps

  1. pnpx create-payload-app my-project -t website
  2. cd my-project && cp .env.example .env
  3. pnpm dev
PS C:\Users\user\Desktop\my-project> pnpm dev

> [email protected] dev C:\Users\user\Desktop\my-project
> cross-env NODE_OPTIONS=--no-deprecation next dev

   ▲ Next.js 15.1.6
   - Local:        http://localhost:3000
   - Network:      http://192.168.0.103:3000
   - Environments: .env
   - Experiments (use with caution):
     · turbo

 ✓ Starting...
 ✓ Ready in 2.3s
 ○ Compiling /_not-found ...
 ✓ Compiled /_not-found in 3.2s (551 modules)
 ⚠ Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
 GET /_next/static/webpack/bd097caf998bd95a.webpack.hot-update.json 404 in 4334ms
 ○ Compiling / ...
 ✓ Compiled / in 8.8s (3682 modules)
 ⨯ Error:
Something went wrong installing the "sharp" module

Which area(s) are affected? (Select all that apply)

area: core

Environment Info

PS C:\Users\user\Desktop\my-project>
                                     pnpm payload info

> [email protected] payload C:\Users\user\Desktop\my-project
> cross-env NODE_OPTIONS=--no-deprecation payload "info"


Binaries:
  Node: 22.11.0
  npm: N/A
  Yarn: N/A
  pnpm: 10.0.0
Relevant Packages:
  payload: 3.19.0
  next: 15.1.6
  @payloadcms/db-postgres: 3.19.0
  @payloadcms/email-nodemailer: 3.19.0
  @payloadcms/graphql: 3.19.0
  @payloadcms/live-preview: 3.19.0
  @payloadcms/live-preview-react: 3.19.0
  @payloadcms/next/utilities: 3.19.0
  @payloadcms/payload-cloud: 3.19.0
  @payloadcms/plugin-form-builder: 3.19.0
  @payloadcms/plugin-nested-docs: 3.19.0
  @payloadcms/plugin-redirects: 3.19.0
  @payloadcms/plugin-search: 3.19.0
  @payloadcms/plugin-seo: 3.19.0
  @payloadcms/richtext-lexical: 3.19.0
  @payloadcms/translations: 3.19.0
  @payloadcms/ui/shared: 3.19.0
  react: 19.0.0
  react-dom: 19.0.0
Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 16316
  Available CPU cores: 6
@NeilRiver NeilRiver added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction labels Jan 26, 2025
Copy link
Contributor

Please add a reproduction in order for us to be able to investigate.

Depending on the quality of reproduction steps, this issue may be closed if no reproduction is provided.

Why was this issue marked with the invalid-reproduction label?

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository created with create-payload-app@beta -t blank or a forked/branched version of this repository with tests added (more info in the reproduction-guide).

To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as minimal as possible. This means that you should remove unnecessary code, files, and dependencies that do not contribute to the issue. Ensure your reproduction does not depend on secrets, 3rd party registries, private dependencies, or any other data that cannot be made public. Avoid a reproduction including a whole monorepo (unless relevant to the issue). The easier it is to reproduce the issue, the quicker we can help.

Please test your reproduction against the latest version of Payload to make sure your issue has not already been fixed.

I added a link, why was it still marked?

Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "example.com", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.

Useful Resources

@NeilRiver
Copy link
Author

this is nonsense

@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Jan 27, 2025
@AlessioGr
Copy link
Member

You have a separate repository "website" and an example "website", which of the two "websites" is worth it and which one should I take?
https://github.com/payloadcms/payload/tree/main/templates/website
https://github.com/payloadcms/website

and another question, why is there a different installer in different examples (yes, I know that I can use any one)?

pnpm install && pnpm dev to install dependencies and start the dev server
Run yarn dev

The first link is our website template. The second link is the payloadcms.com website source code, not a template

and here is also an interesting point... in the documentation you say installation is required, but pnpm says no.

Depending on how the template is cloned down, installation may be required (e.g. if it's cloned down using git).

We'll try to reproduce this on windows. In the meantime, could you create a new project using create-payload-app and share its entire log output? Does the issue only occur using the website template, or is the blank template affected as well?

@r1tsuu r1tsuu linked a pull request Jan 27, 2025 that will close this issue
@r1tsuu
Copy link
Member

r1tsuu commented Jan 27, 2025

I reproduced this on my Windows machine. Initially I didn't with pnpm 8, but I set to 10 (the same as yours) and got the same error.
This is because of breaking pnpm 10 changes - https://github.com/orgs/pnpm/discussions/8945 sharp can't be installed now unless you specify in package.json:

{
  "pnpm": {
    "onlyBuiltDependencies": ["sharp"]
  }
}

I'd suggest you to not use pnpm 10 for now as it doesn't use tag "latest" so I don't think it's considered stable, but you can also add this to your package.json and reinstall node_modules.

@NeilRiver
Copy link
Author

@r1tsuu
thank you love you all

@r1tsuu r1tsuu reopened this Jan 27, 2025
@github-actions github-actions bot added the status: needs-triage Possible bug which hasn't been reproduced yet label Jan 27, 2025
@r1tsuu
Copy link
Member

r1tsuu commented Jan 27, 2025

Let's keep this issue opened while the PR is not merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
create-payload-app status: needs-triage Possible bug which hasn't been reproduced yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants