Создаю чистый проект nextjs или react, одна и та же ошибка

ready - started server on 0.0.0.0:3000, url: http://localhost:3000 info - SWC minify release candidate enabled. https://nextjs.link/swcmin ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.

  • configuration[0].cache.cacheDirectory: The provided value "C:\!Portfolio\main\.next\cache\webpack" contains exclamation mark (!) which is not allowed because it's reserved for loader syntax. -> Base directory for the cache (defaults to node_modules/.cache/webpack).
  • configuration[0].context: The provided value "C:\!Portfolio\main" contains exclamation mark (!) which is not allowed because it's reserved for loader syntax. -> The base directory (absolute path!) for resolving the entry option. If output.pathinfo is set, the included pathinfo is shortened to this directory.
  • configuration[0].module.rules[2].oneOf[4].issuer.and[0].or[0]: The provided value "C:\!Portfolio\main" contains exclamation mark (!) which is not allowed because it's reserved for loader syntax.
  • configuration[0].output.path: The provided value "C:\!Portfolio\main\.next" contains exclamation mark (!) which is not allowed because it's reserved for loader syntax. -> The output directory as absolute path (required).
  • configuration[1].cache.cacheDirectory: The provided value "C:\!Portfolio\main\.next\cache\webpack" contains exclamation mark (!) which is not allowed because it's reserved for loader syntax. -> Base directory for the cache (defaults to node_modules/.cache/webpack).
  • configuration[1].context: The provided value "C:\!Portfolio\main" contains exclamation mark (!) which is not allowed because it's reserved for loader syntax. -> The base directory (absolute path!) for resolving the entry option. If output.pathinfo is set, the included pathinfo is shortened to this directory.
  • configuration[1].module.rules[2].oneOf[4].issuer.and[0].or[0]: The provided value "C:\!Portfolio\main" contains exclamation mark (!) which is not allowed because it's reserved for loader syntax.
  • configuration[1].output.path: The provided value "C:\!Portfolio\main\.next\server" contains exclamation mark (!) which is not allowed because it's reserved for loader syntax. -> The output directory as absolute path (required).
  • configuration[2].cache.cacheDirectory: The provided value "C:\!Portfolio\main\.next\cache\webpack" contains exclamation mark (!) which is not allowed because it's reserved for loader syntax. -> Base directory for the cache (defaults to node_modules/.cache/webpack).
  • configuration[2].context: The provided value "C:\!Portfolio\main" contains exclamation mark (!) which is not allowed because it's reserved for loader syntax. -> The base directory (absolute path!) for resolving the entry option. If output.pathinfo is set, the included pathinfo is shortened to this directory.
  • configuration[2].module.rules[5].oneOf[4].issuer.and[0].or[0]: The provided value "C:\!Portfolio\main" contains exclamation mark (!) which is not allowed because it's reserved for loader syntax.
  • configuration[2].output.path: The provided value "C:\!Portfolio\main\.next\server" contains exclamation mark (!) which is not allowed because it's reserved for loader syntax. -> The output directory as absolute path (required). at validate (C:!Portfolio\main\node_modules\next\dist\compiled\schema-utils3\index.js:1:150815) at validateSchema (C:!Portfolio\main\node_modules\next\dist\compiled\webpack\bundle5.js:139440:2) at create (C:!Portfolio\main\node_modules\next\dist\compiled\webpack\bundle5.js:142939:24) at webpack (C:!Portfolio\main\node_modules\next\dist\compiled\webpack\bundle5.js:142986:32) at Object.f [as webpack] (C:!Portfolio\main\node_modules\next\dist\compiled\webpack\bundle5.js:97431:16)
    at HotReloader.start (C:!Portfolio\main\node_modules\next\dist\server\dev\hot-reloader.js:433:45) at async DevServer.prepare (C:!Portfolio\main\node_modules\next\dist\server\dev\next-dev-server.js:365:9)
    at async C:!Portfolio\main\node_modules\next\dist\cli\next-dev.js:147:9 { errors: [ {

Ответы (1 шт):

Автор решения: igorman2005

C:!Portfolio - проблема в том, что путь, содержит "!". webpack, angular - многие из них не любят такие пути ;)

о чём собственно и гласит сообщение: "contains exclamation mark (!) which is not allowed because it's reserved for loader syntax"

→ Ссылка