npm run build problem cause npm run start didn't work right #7964

Closed
opened 2026-02-21 18:23:16 -05:00 by yindo · 3 comments
Owner

Originally created by @robmlee on GitHub (Feb 4, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.15.2

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

I follow the installation guide at: https://docs.dify.ai/getting-started/install-self-hosted/local-source-code

When execute ' npm run build' I got compiled with warnings mesg:

> dify-web@0.15.2 build
> next build

  ▲ Next.js 14.2.23
  - Environments: .env

   Creating an optimized production build ...
 ⚠ Compiled with warnings

./app/components/base/chat/embedded-chatbot/hooks.tsx
Attempted import error: 'getPrevChatList' is not exported from '../utils' (imported as 'getPrevChatList').

Import trace for requested module:
./app/components/base/chat/embedded-chatbot/hooks.tsx
./app/components/base/chat/embedded-chatbot/index.tsx
./app/(shareLayout)/chatbot/[token]/page.tsx

./app/components/base/chat/embedded-chatbot/hooks.tsx
Attempted import error: 'getPrevChatList' is not exported from '../utils' (imported as 'getPrevChatList').

Import trace for requested module:
./app/components/base/chat/embedded-chatbot/hooks.tsx
./app/components/base/chat/embedded-chatbot/index.tsx
./app/(shareLayout)/chatbot/[token]/page.tsx

and when brower the url http://myip:3000 after execute npm run start, the page shows 4 little squares running in turn only.

✔️ Expected Behavior

when brower the url http://myip:3000 after execute npm run start, the page should show the administator account setting.

Actual Behavior

when brower the url http://myip:3000 after execute npm run start, the page shows 4 little squares running in turn only.

Originally created by @robmlee on GitHub (Feb 4, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.15.2 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce I follow the installation guide at: https://docs.dify.ai/getting-started/install-self-hosted/local-source-code ``` When execute ' npm run build' I got compiled with warnings mesg: > dify-web@0.15.2 build > next build ▲ Next.js 14.2.23 - Environments: .env Creating an optimized production build ... ⚠ Compiled with warnings ./app/components/base/chat/embedded-chatbot/hooks.tsx Attempted import error: 'getPrevChatList' is not exported from '../utils' (imported as 'getPrevChatList'). Import trace for requested module: ./app/components/base/chat/embedded-chatbot/hooks.tsx ./app/components/base/chat/embedded-chatbot/index.tsx ./app/(shareLayout)/chatbot/[token]/page.tsx ./app/components/base/chat/embedded-chatbot/hooks.tsx Attempted import error: 'getPrevChatList' is not exported from '../utils' (imported as 'getPrevChatList'). Import trace for requested module: ./app/components/base/chat/embedded-chatbot/hooks.tsx ./app/components/base/chat/embedded-chatbot/index.tsx ./app/(shareLayout)/chatbot/[token]/page.tsx ``` and when brower the url http://myip:3000 after execute npm run start, the page shows 4 little squares running in turn only. ### ✔️ Expected Behavior when brower the url http://myip:3000 after execute npm run start, the page should show the administator account setting. ### ❌ Actual Behavior when brower the url http://myip:3000 after execute npm run start, the page shows 4 little squares running in turn only.
yindo added the 🤔 cant-reproduce label 2026-02-21 18:23:16 -05:00
yindo closed this issue 2026-02-21 18:23:16 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 4, 2025):

Hello @robmlee! I'm here to help you with any bugs, questions, or contributions you may have. Let's work together to solve the issue you're facing.

The issue you're encountering with the npm run build command is due to an import error: 'getPrevChatList' is not exported from '../utils'. This means that the getPrevChatList function is either missing from the ../utils module or not properly exported.

To resolve this, you should:

  1. Check the ../utils Module: Verify that the getPrevChatList function is defined and exported in the ../utils module. If it's missing, you need to implement it or ensure it's correctly exported.

  2. Correct the Export: If the function is defined but not exported, add an export statement for getPrevChatList in the ../utils module. It should look something like this:

    export const getPrevChatList = () => {
        // function implementation
    };
    
  3. Rebuild the Project: After making the necessary changes, run npm run build again to see if the issue is resolved.

Regarding the issue with the page showing only loading squares after running npm run start, this is likely related to the build issue. Once the import error is fixed, the application should build correctly, and the frontend should display as expected.

If the problem persists after fixing the import error, ensure that all necessary services (like the API and database) are running and properly configured, as these could also affect the application's ability to load correctly.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot[bot] commented on GitHub (Feb 4, 2025): <!-- Greeting --> Hello @robmlee! I'm here to help you with any bugs, questions, or contributions you may have. Let's work together to solve the issue you're facing. <!-- Answer --> The issue you're encountering with the `npm run build` command is due to an import error: `'getPrevChatList' is not exported from '../utils'`. This means that the `getPrevChatList` function is either missing from the `../utils` module or not properly exported. To resolve this, you should: 1. **Check the `../utils` Module**: Verify that the `getPrevChatList` function is defined and exported in the `../utils` module. If it's missing, you need to implement it or ensure it's correctly exported. 2. **Correct the Export**: If the function is defined but not exported, add an export statement for `getPrevChatList` in the `../utils` module. It should look something like this: ```javascript export const getPrevChatList = () => { // function implementation }; ``` 3. **Rebuild the Project**: After making the necessary changes, run `npm run build` again to see if the issue is resolved. Regarding the issue with the page showing only loading squares after running `npm run start`, this is likely related to the build issue. Once the import error is fixed, the application should build correctly, and the frontend should display as expected. If the problem persists after fixing the import error, ensure that all necessary services (like the API and database) are running and properly configured, as these could also affect the application's ability to load correctly. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/075efe87-e870-4350-a83c-7b34e1fc8e1f?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/075efe87-e870-4350-a83c-7b34e1fc8e1f?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/075efe87-e870-4350-a83c-7b34e1fc8e1f?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/075efe87-e870-4350-a83c-7b34e1fc8e1f?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/075efe87-e870-4350-a83c-7b34e1fc8e1f?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/075efe87-e870-4350-a83c-7b34e1fc8e1f?feedback_type=other)</sup>
Author
Owner

@robmlee commented on GitHub (Feb 4, 2025):

After checking the web/app/components/base/chat/utils.ts, there is no function named getPrevChatList.

export const getPrevChatList = () => { 
      // function implementation 
 };

Could someone help to verify should this funciton need to be added in the utils.ts

@robmlee commented on GitHub (Feb 4, 2025): After checking the web/app/components/base/chat/utils.ts, there is no function named getPrevChatList. ``` export const getPrevChatList = () => { // function implementation }; ``` Could someone help to verify should this funciton need to be added in the utils.ts
Author
Owner

@crazywoola commented on GitHub (Feb 4, 2025):

If you see the 4 squares keeps spinning, please check the environment settings instead. Please use discussion for questions.

@crazywoola commented on GitHub (Feb 4, 2025): If you see the 4 squares keeps spinning, please check the environment settings instead. Please use discussion for questions.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7964