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: Cannot find module './router' #63

Open
Thispain opened this issue Oct 21, 2023 · 2 comments
Open

Error: Cannot find module './router' #63

Thispain opened this issue Oct 21, 2023 · 2 comments

Comments

@Thispain
Copy link

When I try to run the project with "node app.js" I get this error message.

I took the following steps to eliminate the error message:

  • I used the "npm install router" command: It didn't change the situation.
  • I deleted line 50 from the app.js file: The page said "Cannot GET /" and I found 2 error messages on the browser console:
  • GET http://127.0.0.1:5000/ 404 (Not Found)
  • Refused to load the image 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABklJREFUeNqsmFtwE1UYx/97Tdqkbei91Gk6IFouYjqjBR3aQTstoM40DD4gOIO++ sL4pr45+q7iu+OMyJMD1RcZAXGEBxiUm0JrKfQiDoVeSEmv2WSP3znJJpt0d1Mgpz3d3bPJnt/+v8v5TqX9X89HGMNZ6iGGdGOZP9a11Riz3bddm4n4tz991Pg+SthkDmVmoPhE2Q5bLxwruIakRVHiJnMo+9s/SZ MULfTW56PRUiuWB8UKjmCrIqNfva+kYPb5vRiYi5/lnuQrsWIOkzyWWixnzjc/K505VUcgN9Ai5qwo1w7duHknFgzoUDU5Ky+z+YrbuW3sajgcjqmsCAnzSBeFLcn06NJSPBoI+CBJMmQZjw1mmmZsbGzsQ3kFUBEopxewb...GUQklGizqDT1Nxc FdnVrlTF6877CtTy7FCACcQV9N6po /cOa9sByZUGFTZ8mfrVDi+u7sLW9eH8Xb3K3lq8aOyvuuD+7Rp2kkLqh+MQrVIZ/xoOo8z69q0nVudkFVa2jc2GNCoDFKogNTIrG3hZqiZxCrZdi7ibNenIyFRKK1iZ+vse5S9R4YPI4Wom015mb23pwqvbinLLuq0T csmVAsqeyzVln5n37GorAZPiFKm0LykYF9vFba1V9GuSYVPV0kxWWzt8lTKZP6SgvH2+r7+h5Ksh/KVMhHtrSSoSrHX1AmKl9tuUNaYXNL/trFUP6+5cmteGqojUkmmU0TnvrWanVJJwZhp/JgOBEoLJm2WeyoIqoKUkkXnUGlBmC cUrzZKCna2f3+/aRoxrlRfTxAvbw0Ks/EuZ0prt1RkV5E2yTEVJW6pVKK/r7fivfbNZeQ4JhnWFFGbTKbyo67Ap6zo5FDUX/tfgAEAQ3WUFGFdgUwAAAAASUVORK5CYII=' because it violates the following Content Security Policy directive: "default-src 'none' '". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.

I fixed the 2nd error by running "scripts/postinstall.js", but the 1st is remained here.

@demipixel
Copy link
Owner

Try running it with npm run dev or npm run build && npm run start

@Thispain
Copy link
Author

Thispain commented Oct 22, 2023

I was running it with npm run dev and:

  • I get this error message on the console:

[email protected] dev
next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
wait - compiling...
event - compiled client and server successfully in 6.8s (1042 modules)
wait - compiling /outpost (client and server)...
wait - compiling...
error - ./node_modules/factorio-generators/tools/blueprintTool.js:1:0
Module not found: Can't resolve 'factorio-blueprint'

Import trace for requested module:
./node_modules/factorio-generators/index.js
./lib/generators/ore-outpost.generator.ts
./pages/outpost.tsx

https://nextjs.org/docs/messages/module-not-found
wait - compiling /_error (client and server)...
wait - compiling...
event - compiled client and server successfully in 25.1s (1043 modules)
error - Error: Cannot find module '$MYLOCALPATH\autotorio\node_modules\factorio-blueprint\dist\factorio-blueprint.min.js'. Please verify that the package.json has a valid "main" entry

  • And I get it on the website (not in broswer console):

Failed to compile
./node_modules/factorio-generators/tools/blueprintTool.js:1:0
Module not found: Can't resolve 'factorio-blueprint'

Import trace for requested module:
./node_modules/factorio-generators/index.js
./lib/generators/ore-outpost.generator.ts
./pages/outpost.tsx

https://nextjs.org/docs/messages/module-not-found
This error occurred during the build process and can only be dismissed by fixing the error.

I was using npm install factorio-blueprint command, and it didn't change the situation, because the factorio-blueprint package have not dist folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants