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

Error on start #4

Open
1 task done
Konard opened this issue Sep 30, 2023 · 2 comments
Open
1 task done

Error on start #4

Konard opened this issue Sep 30, 2023 · 2 comments
Labels
bug Something isn't working sweep

Comments

@Konard
Copy link
Member

Konard commented Sep 30, 2023

Screenshot_20230930_164457

1 of 1 unhandled error
Server Error
Error: Cannot find module '/workspace/dev/packages/sdk/app/server/client-reference-manifest.json'
Require stack:
- /workspace/dev/packages/sdk/node_modules/next/dist/server/next-server.js
- /workspace/dev/packages/sdk/node_modules/next/dist/server/dev/next-dev-server.js
- /workspace/dev/packages/sdk/node_modules/next/dist/server/next.js
- /workspace/dev/packages/sdk/node_modules/next/dist/server/lib/render-server.js
- /workspace/dev/packages/sdk/node_modules/next/dist/compiled/jest-worker/processChild.js

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
Module._resolveFilename
node:internal/modules/cjs/loader (1077:15)
<unknown>
file:///workspace/dev/packages/sdk/node_modules/next/dist/server/require-hook.js (189:36)
Module._load
node:internal/modules/cjs/loader (922:27)
Module.require
node:internal/modules/cjs/loader (1143:19)
require
node:internal/modules/cjs/helpers (121:18)
DevServer.getServerComponentManifest
file:///workspace/dev/packages/sdk/node_modules/next/dist/server/next-server.js (809:16)
DevServer.findPageComponents
file:///workspace/dev/packages/sdk/node_modules/next/dist/server/dev/next-dev-server.js (1258:54)
process.processTicksAndRejections
node:internal/process/task_queues (95:5)
async DevServer.renderErrorToResponseImpl
file:///workspace/dev/packages/sdk/node_modules/next/dist/server/base-server.js (1534:26)
async pipe.req.req
file:///workspace/dev/packages/sdk/node_modules/next/dist/server/base-server.js (1461:30)
async DevServer.pipeImpl
file:///workspace/dev/packages/sdk/node_modules/next/dist/server/base-server.js (641:25)
async DevServer.run
file:///workspace/dev/packages/sdk/node_modules/next/dist/server/dev/next-dev-server.js (905:28)
async DevServer.handleRequestImpl
file:///workspace/dev/packages/sdk/node_modules/next/dist/server/base-server.js (546:20)
Checklist
@Konard Konard added bug Something isn't working sweep labels Sep 30, 2023
@deep-foundation-sweepai
Copy link

deep-foundation-sweepai bot commented Sep 30, 2023

Here's the PR! #5.

💎 Sweep Pro: I'm creating this ticket using GPT-4. You have unlimited GPT-4 tickets.

Actions (click)

  • ↻ Restart Sweep

Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description.

// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
include ':capacitor-android'
project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
include ':capacitor-action-sheet'
project(':capacitor-action-sheet').projectDir = new File('../node_modules/@capacitor/action-sheet/android')
include ':capacitor-camera'
project(':capacitor-camera').projectDir = new File('../node_modules/@capacitor/camera/android')
include ':capacitor-clipboard'
project(':capacitor-clipboard').projectDir = new File('../node_modules/@capacitor/clipboard/android')
include ':capacitor-device'
project(':capacitor-device').projectDir = new File('../node_modules/@capacitor/device/android')
include ':capacitor-dialog'
project(':capacitor-dialog').projectDir = new File('../node_modules/@capacitor/dialog/android')
include ':capacitor-geolocation'
project(':capacitor-geolocation').projectDir = new File('../node_modules/@capacitor/geolocation/android')
include ':capacitor-haptics'
project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/haptics/android')
include ':capacitor-local-notifications'
project(':capacitor-local-notifications').projectDir = new File('../node_modules/@capacitor/local-notifications/android')
include ':capacitor-network'
project(':capacitor-network').projectDir = new File('../node_modules/@capacitor/network/android')
include ':capacitor-push-notifications'
project(':capacitor-push-notifications').projectDir = new File('../node_modules/@capacitor/push-notifications/android')
include ':capacitor-screen-reader'
project(':capacitor-screen-reader').projectDir = new File('../node_modules/@capacitor/screen-reader/android')
include ':capawesome-capacitor-file-picker'
project(':capawesome-capacitor-file-picker').projectDir = new File('../node_modules/@capawesome/capacitor-file-picker/android')
include ':capacitor-voice-recorder'

include ':app'
include ':capacitor-cordova-android-plugins'
project(':capacitor-cordova-android-plugins').projectDir = new File('./capacitor-cordova-android-plugins/')

import { WithPackagesInstalled } from "@deep-foundation/react-with-packages-installed";
import { WithProviders } from "./with-providers";
import { StoreProvider } from "./store-provider";
import { Button, CircularProgress, Stack, Text, VStack } from "@chakra-ui/react";
import { useLocalStore } from "@deep-foundation/store/local";
import { CapacitorStoreKeys } from "../../capacitor-store-keys";
import {
DeepClient,
DeepProvider,
useDeep,
} from "@deep-foundation/deeplinks/imports/client";
import { ErrorAlert } from "./error-alert";
import { WithLogin } from "./with-login";
import { WithAddDebugFieldsToWindow } from "./with-add-debug-fields-to-window";
export interface PageParam {
renderChildren: (param: { deep: DeepClient }) => JSX.Element;
}
export function Page({ renderChildren }: PageParam) {
return (
<WithProviders>
<WithLogin>
<WithDeep
renderChildren={({ deep }) => {
return (
<WithPackagesInstalled
deep={deep}
packageNames={[]}
renderIfError={(error) => <ErrorAlert title={error.message} />}
renderIfNotInstalled={(packageNames) => (
<>
<ErrorAlert
title={`Install these deep packages to proceed: ${packageNames.join(
", "
)}`}
/>
</>
)}
renderIfLoading={() => (
<VStack height="100vh" justifyContent={"center"}>
<CircularProgress isIndeterminate />
<Text>Checking if deep packages are installed...</Text>
</VStack>
)}
>
<>
{renderChildren({ deep })}
{
process.env.NODE_ENV === 'development' && <WithAddDebugFieldsToWindow />
}
</>
</WithPackagesInstalled>
);
}}
/>
</WithLogin>
</WithProviders>
);
}
interface WithDeepProps {
renderChildren: (param: { deep: DeepClient }) => JSX.Element;
}
function WithDeep({ renderChildren }: WithDeepProps) {
const deep = useDeep();
return deep.linkId ? renderChildren({ deep }) : null;

I also found the following external resources that might be helpful:

Summaries of links found in the content:

I also found some related docs:


Step 2: ⌨️ Coding

• Check the build process to ensure that it is generating the 'client-reference-manifest.json' file. • If the file is not being generated, modify the build process to generate the 'client-reference-manifest.json' file. • Check the path where the 'client-reference-manifest.json' file is being placed after it is generated. • If the file is not being placed in the '/workspace/dev/packages/sdk/app/server/' path, modify the build process to place it in this path.

Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/fix-error-on-start.

.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request.
Join Our Discord

@FreePhoenix888
Copy link
Member

gpt4 answer:
This error message suggests that there's a problem with your Next.js project setup. Specifically, the module or file named client-reference-manifest.json is missing, which is causing the server-side rendering of your page to fail.

Here's how you can diagnose and potentially fix this issue:

  1. Check if the file exists:

    • Navigate to /workspace/dev/packages/sdk/app/server/ and check if client-reference-manifest.json exists. If not, it might have been deleted accidentally or was never created in the first place.
  2. Dependencies and Versioning:

    • Ensure that all dependencies in your package.json file are correctly installed. You can re-install them using:
      npm install
      
    • If you recently upgraded the version of Next.js or any other relevant dependency, consider rolling back to a previous version that worked without this issue.
  3. Next.js Configuration:

    • Ensure that your next.config.js (if you have one) doesn't have any misconfigurations that might be leading to this error.
  4. Rebuild the Project:

    • Sometimes, cached files or a bad build can cause issues. Try deleting the .next directory in your project root and rebuild the project:
      npm run build
      
  5. Logs and Debugging:

    • The error message suggests that any console logs related to this error will be displayed in the terminal window. Inspect those logs to gather more context about the error. This might give you clues about any missing configurations or other issues.
  6. Other Modules or Plugins:

    • If you're using other plugins or configurations alongside Next.js, consider disabling them temporarily to see if they might be causing this issue.
  7. Next.js Documentation and Community:

    • Check the official Next.js documentation and forums. It's possible that other developers have encountered this issue and shared solutions or workarounds.
  8. Last Resort:

    • If nothing else works, consider creating a new Next.js project using create-next-app and then migrate your code and assets to this new project. This can help if there are fundamental issues with the project setup.

Remember, whenever you're debugging, make incremental changes and test each time to see if the error goes away. This way, you can pinpoint the exact cause of the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sweep
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants