axa-group / nlp.js

An NLP library for building bots, with entity extraction, sentiment analysis, automatic language identify, and so more
MIT License
6.29k stars 621 forks source link

Critical dependency: the request of a dependency is an expression #1344

Closed s-iliyas closed 1 year ago

s-iliyas commented 1 year ago

Verify canary release

Provide environment information

Operating System:
      Platform: linux
      Arch: x64
      Version: #47~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jun 21 15:35:31 UTC 2
    Binaries:
      Node: 19.9.0
      npm: 9.6.0
      Yarn: N/A
      pnpm: N/A
    Relevant Packages:
      next: 13.4.10
      eslint-config-next: 13.4.10
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.6
    Next.js Config:
      output: N/A

warn  - Latest canary version not detected, detected: "13.4.10", newest: "13.4.11-canary.0".
        Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
        Read more - https://nextjs.org/docs/messages/opening-an-issue

Which area(s) of Next.js are affected? (leave empty if unsure)

App Router

Link to the code that reproduces this issue or a replay of the bug

https://github.com/s-iliyas/portfolio

To Reproduce

Install dependencies

yarn

Run server

yarn dev

To see warnings

Click on logout button present in navbar and check server logs

Describe the Bug

I don't know why I'm getting this warnings, which are annoying.

Import trace for requested module:
./node_modules/@nlpjs/core-loader/src/container-bootstrap.js
./node_modules/@nlpjs/core-loader/src/index.js
./node_modules/node-nlp/src/nlp/nlp-util.js
./node_modules/node-nlp/src/nlp/index.js
./node_modules/node-nlp/src/index.js
./app/api/bot/route.js

./node_modules/@nlpjs/core-loader/src/container-bootstrap.js
Critical dependency: the request of a dependency is an expression

Expected Behavior

Maybe just compiling server logs should be present.

Which browser are you using? (if relevant)

Google Chrome

How are you deploying your application? (if relevant)

Only in local, yarn dev.

jesus-seijas-sp commented 1 year ago

You are trying to load a backend only library (@nlpjs/core-loader) into the frontend. Please read the docs about building for frontend: https://github.com/axa-group/nlp.js/blob/master/docs/v4/webandreact.md

s-iliyas commented 1 year ago

https://github.com/vercel/next.js/issues/52876#issuecomment-1647623310 Duplicate issue that I created and solved.