mui / toolpad

Toolpad: Full stack components and low-code builder for dashboards and internal apps.
https://mui.com/toolpad/
MIT License
1.28k stars 283 forks source link

Error: Cannot find module 'mui-toolpad/dist/index.js' #2691

Closed amozoss closed 1 year ago

amozoss commented 1 year ago

Duplicates

Latest version

Steps to reproduce 🕹

Steps:

  1. yarn install
  2. yarn dev
  3. yarn toolpad dev test/integration/backend-basic/fixture --dev

Current behavior 😯

It's throwing an error.

$ yarn toolpad dev test/integration/backend-basic/fixture --dev 
node:internal/modules/cjs/loader:1080
  throw err;
  ^

Error: Cannot find module '/Users/dan/test/mui-toolpad/dist/index.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v18.16.1

Expected behavior 🤔

For there to be no error

Context 🔦

Was following the contributing.md guide to run examples/qr-generator and got an error. Then I Realized I got the same error for est/integration/backend-basic/fixture too and that's easier to report in the issue.

Your environment 🌎

npx @mui/envinfo ``` System: OS: macOS 13.4 Binaries: Node: 18.16.1 - ~/.nvm/versions/node/v18.16.1/bin/node Yarn: 3.6.1 - ~/.nvm/versions/node/v18.16.1/bin/yarn npm: 9.5.1 - ~/.nvm/versions/node/v18.16.1/bin/npm Browsers: Chrome: 116.0.5845.187 (using chrome) Edge: Not Found Safari: 16.5 ```
JerryWu1234 commented 1 year ago

manbe you need to offer more details. such as your OS,

amozoss commented 1 year ago

Thanks for the reply. It's there in the accordion OS: macOS 13.4. Suppose it doesn't say it's an M1 though

Janpot commented 1 year ago

Likely related to the version of yarn you are running. Could you try with

git diff
diff --git a/package.json b/package.json
index 2bde0abca..a2106104f 100644
--- a/package.json
+++ b/package.json
@@ -40,7 +40,7 @@
     "test:argos": "node ./scripts/pushArgos.mjs",
     "test": "lerna run test",
     "check-types": "lerna run check-types",
-    "toolpad": "toolpad",
+    "toolpad": "node packages/toolpad-app/cli.js",
     "jsonSchemas": "tsx ./scripts/docs/generateJsonSchemas.ts",
     "test:rest:start": "tsx ./scripts/restTestServer.ts"
   },
amozoss commented 1 year ago

That fixed it, thanks!

Janpot commented 1 year ago

Thanks, that's great to hear. I'm reopening, we should fix this.