Итак, последнюю неделю или около того я работал над проектом — веб-сайтом для поклонников группы Gorillaz. Я делаю этот проект, чтобы выполнить требования курса Front End Engineering, который я прохожу.
В общем, пока веб-сайт представляет собой всего лишь пару страниц с React Routes, ведущими к каждой из них. У меня маршруты работают. Затем я создал страницу с данными токенов API с сайта Ticketmaster.com, на которой будут показаны даты тура группы. Кажется, это просто требует небольшой настройки, data.map is not a function
и т. д. и т. п. Но, тем не менее, большая проблема, с которой я столкнулся, связана с чатом IRC на базе NodeIRC, который я хотел бы реализовать, чтобы потенциальные пользователи могли собираться в чате и обсуждать музыку. или что-то еще и т. д. После того, как я установил NodeIRC и попытался связать его на странице, я получил жалобу из журнала ошибок, в которой говорилось, что мне понадобится веб-пакет, чтобы делать то, что я пытаюсь сделать. В любом случае, после установки веб-пакета я получаю вот такой журнал ошибок (я также включу свой основной файл App.js, имейте в виду, что это приложение на основе React).
ERROR in ./node_modules/chrome-trace-event/dist/trace-event.js 13:17-34
Module not found: Error: Can't resolve 'stream' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/chrome-trace-event/dist'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
- install 'stream-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "stream": false }
ERROR in ./node_modules/enhanced-resolve/lib/MainFieldPlugin.js 8:13-28
Module not found: Error: Can't resolve 'path' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/enhanced-resolve/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/enhanced-resolve/lib/util/path.js 8:13-28
Module not found: Error: Can't resolve 'path' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/enhanced-resolve/lib/util'
Did you mean './path'?
Requests that should resolve in the current directory need to start with './'.
Requests that start with a name are treated as module requests and resolve within module directories (node_modules, /home/eliast/Documents/final reactapp project/gorillazfansite/node_modules).
If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/graceful-fs/graceful-fs.js 1:9-22
Module not found: Error: Can't resolve 'fs' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/graceful-fs'
ERROR in ./node_modules/graceful-fs/legacy-streams.js 1:13-37
Module not found: Error: Can't resolve 'stream' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/graceful-fs'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
- install 'stream-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "stream": false }
ERROR in ./node_modules/graceful-fs/polyfills.js 1:16-36
Module not found: Error: Can't resolve 'constants' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/graceful-fs'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "constants": require.resolve("constants-browserify") }'
- install 'constants-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "constants": false }
ERROR in ./node_modules/jest-worker/build/base/BaseWorkerPool.js 8:39-54
Module not found: Error: Can't resolve 'path' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/jest-worker/build/base'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/jest-worker/build/index.js 26:15-28
Module not found: Error: Can't resolve 'os' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/jest-worker/build'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "os": require.resolve("os-browserify/browser") }'
- install 'os-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "os": false }
ERROR in ./node_modules/jest-worker/build/workers/ChildProcessWorker.js 8:15-39
Module not found: Error: Can't resolve 'child_process' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/jest-worker/build/workers'
ERROR in ./node_modules/jest-worker/build/workers/ChildProcessWorker.js 15:15-32
Module not found: Error: Can't resolve 'stream' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/jest-worker/build/workers'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
- install 'stream-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "stream": false }
ERROR in ./node_modules/jest-worker/build/workers/NodeThreadsWorker.js 8:39-54
Module not found: Error: Can't resolve 'path' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/jest-worker/build/workers'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/jest-worker/build/workers/NodeThreadsWorker.js 15:15-32
Module not found: Error: Can't resolve 'stream' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/jest-worker/build/workers'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
- install 'stream-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "stream": false }
ERROR in ./node_modules/jest-worker/build/workers/NodeThreadsWorker.js 22:15-40
Module not found: Error: Can't resolve 'worker_threads' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/jest-worker/build/workers'
ERROR in ./node_modules/jest-worker/build/workers/messageParent.js 21:8-33
Module not found: Error: Can't resolve 'worker_threads' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/jest-worker/build/workers'
ERROR in ./node_modules/loader-runner/lib/LoaderRunner.js 5:9-22
Module not found: Error: Can't resolve 'fs' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/loader-runner/lib'
ERROR in ./node_modules/merge-stream/index.js 5:4-21
Module not found: Error: Can't resolve 'stream' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/merge-stream'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
- install 'stream-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "stream": false }
ERROR in ./node_modules/mime-types/index.js 15:14-37
Module not found: Error: Can't resolve 'path' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/mime-types'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/node-irc/lib/client.js 29:16-30
Module not found: Error: Can't resolve 'net' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/node-irc/lib'
ERROR in ./node_modules/terser-webpack-plugin/dist/index.js 3:13-28
Module not found: Error: Can't resolve 'path' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/terser-webpack-plugin/dist'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/terser-webpack-plugin/dist/index.js 4:11-24
Module not found: Error: Can't resolve 'os' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/terser-webpack-plugin/dist'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "os": require.resolve("os-browserify/browser") }'
- install 'os-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "os": false }
ERROR in ./node_modules/terser-webpack-plugin/dist/utils.js 406:6-26
Module not found: Error: Can't resolve 'uglify-js' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/terser-webpack-plugin/dist'
ERROR in ./node_modules/terser-webpack-plugin/dist/utils.js 484:14-34
Module not found: Error: Can't resolve '@swc/core' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/terser-webpack-plugin/dist'
ERROR in ./node_modules/terser-webpack-plugin/dist/utils.js 567:18-36
Module not found: Error: Can't resolve 'esbuild' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/terser-webpack-plugin/dist'
ERROR in ./node_modules/watchpack/lib/DirectoryWatcher.js 9:13-28
Module not found: Error: Can't resolve 'path' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/watchpack/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/watchpack/lib/DirectoryWatcher.js 13:15-37
Module not found: Error: Can't resolve 'os' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/watchpack/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "os": require.resolve("os-browserify/browser") }'
- install 'os-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "os": false }
ERROR in ./node_modules/watchpack/lib/LinkResolver.js 7:11-24
Module not found: Error: Can't resolve 'fs' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/watchpack/lib'
ERROR in ./node_modules/watchpack/lib/LinkResolver.js 8:13-28
Module not found: Error: Can't resolve 'path' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/watchpack/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/watchpack/lib/getWatcherManager.js 7:13-28
Module not found: Error: Can't resolve 'path' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/watchpack/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/watchpack/lib/reducePlan.js 7:13-28
Module not found: Error: Can't resolve 'path' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/watchpack/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/watchpack/lib/watchEventSource.js 7:11-24
Module not found: Error: Can't resolve 'fs' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/watchpack/lib'
ERROR in ./node_modules/watchpack/lib/watchEventSource.js 8:13-28
Module not found: Error: Can't resolve 'path' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/watchpack/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/watchpack/lib/watchEventSource.js 13:15-37
Module not found: Error: Can't resolve 'os' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/watchpack/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "os": require.resolve("os-browserify/browser") }'
- install 'os-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "os": false }
ERROR in ./node_modules/webpack/hot/lazy-compilation-node.js 18:47-63
Module not found: Error: Can't resolve 'https' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/webpack/hot'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "https": require.resolve("https-browserify") }'
- install 'https-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "https": false }
ERROR in ./node_modules/webpack/hot/lazy-compilation-node.js 18:66-81
Module not found: Error: Can't resolve 'http' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/webpack/hot'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }'
- install 'stream-http'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "http": false }
ERROR in ./node_modules/webpack/lib/FileSystemInfo.js 11:19-36
Module not found: Error: Can't resolve 'module' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/webpack/lib'
ERROR in ./node_modules/webpack/lib/FileSystemInfo.js 15:4-19
Module not found: Error: Can't resolve 'path' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/webpack/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/webpack/lib/NormalModule.js 13:20-42
Module not found: Error: Can't resolve 'querystring' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/webpack/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "querystring": require.resolve("querystring-es3") }'
- install 'querystring-es3'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "querystring": false }
ERROR in ./node_modules/webpack/lib/TemplatedPathPlugin.js 12:4-19
Module not found: Error: Can't resolve 'path' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/webpack/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/webpack/lib/asset/AssetGenerator.js 9:13-28
Module not found: Error: Can't resolve 'path' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/webpack/lib/asset'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/webpack/lib/cli.js 8:13-28
Module not found: Error: Can't resolve 'path' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/webpack/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/webpack/lib/config/browserslistTargetHandler.js 9:13-28
Module not found: Error: Can't resolve 'path' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/webpack/lib/config'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/webpack/lib/config/defaults.js 8:11-24
Module not found: Error: Can't resolve 'fs' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/webpack/lib/config'
ERROR in ./node_modules/webpack/lib/config/defaults.js 9:13-28
Module not found: Error: Can't resolve 'path' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/webpack/lib/config'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/webpack/lib/hmr/lazyCompilationBackend.js 30:27-43
Module not found: Error: Can't resolve 'https' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/webpack/lib/hmr'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "https": require.resolve("https-browserify") }'
- install 'https-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "https": false }
ERROR in ./node_modules/webpack/lib/hmr/lazyCompilationBackend.js 30:46-61
Module not found: Error: Can't resolve 'http' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/webpack/lib/hmr'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }'
- install 'stream-http'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "http": false }
ERROR in ./node_modules/webpack/lib/javascript/JavascriptModulesPlugin.js 14:11-24
Module not found: Error: Can't resolve 'vm' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/webpack/lib/javascript'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "vm": require.resolve("vm-browserify") }'
- install 'vm-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "vm": false }
ERROR in ./node_modules/webpack/lib/javascript/JavascriptParser.js 18:11-24
Module not found: Error: Can't resolve 'vm' in '/home/eliast/Documents/final reactapp project/gorillazfansite/node_modules/webpack/lib/javascript'
И это продолжается и продолжается вот так
Файл App.js я покажу во втором посте (комната NodeIRC реализуется в другом файле ForumsandIRC.js, который я могу предоставить по запросу):
Отвечает ли это на ваш вопрос? Как заполнять модули ядра узла Polyfill в Webpack 5
Я попробовал несколько решений в этой теме и все равно получаю 56 ошибок, в основном все из которых связаны с проблемой полифилов Webpack 5.
для справки: я программирую всего около 6 месяцев. Возможно, я неправильно реализовал веб-пакет. Я не уверен на 100%.
Я не могу отметить дубликат, но это та же проблема, что и эта -> stackoverflow.com/a/78161983/9718056
@Arkellys Я посмотрю эту тему на выходных. Большое спасибо. Как я уже сказал, я новичок, поэтому иногда мне кажется, что я знаю, что делаю, но это не так.
Все нормально. Если это решит вашу проблему, я был бы рад получить ответ за ответ, чтобы я мог использовать его для дубликатов в будущем. На самом деле это очень распространенная проблема.
Эй, согласно этому ответу, проблема в файле webpack.config.js? Если да, то как мне исправить проблемы с файлом конфигурации? Я не чувствую себя ближе к пониманию этого, извини.
Хорошо, вот в чем дело. Я оставил файл webpack.config.js в покое и решил поставить npm i *package name* -S
для всех пакетов, для которых я получал коды ошибок. Теперь я получаю только 20 ошибок, что не так уж плохо, но я все еще не могу устранить остальные, все еще в основном связанные с кодом ошибки веб-пакета.
@Emandudeguy В ответе объясняется, в чем проблема и как ее решить. Вам не нужно устанавливать новые пакеты или редактировать конфигурацию веб-пакета. Что ты не понимаешь? Я могу отредактировать, чтобы добавить больше деталей.
Я не уверен, как реализовать ваше решение, потому что я не использую ни один из модулей, которые вы упомянули в своем ответе. Не использую Electron или Node.js. Я сузил список до 20 ошибок из 56, мне все равно нужно найти недостающее звено, потому что я чего-то не понимаю. Я не знаю, как выполнить предварительную загрузку, потому что никогда этого не делал и не уверен, что это то, что мне нужно в моей конкретной ситуации.
@Emandudeguy Я чувствую себя глупо, я был уверен, что ты использовал Electron! Я перепутал теги просмотра. Так что нет, никакой предварительной нагрузки или чего-то подобного. Однако причина ошибки все еще актуальна. Напишу ответ по вашему случаю.
Полученная ошибка означает, что вы пытаетесь скомпилировать код Node.js с помощью веб-пакета, но он для этого не настроен. Если приложение React создано с помощью CRA , для цели Webpack установлено значение по умолчанию browserlist
, как вы можете видеть в конфигурации React-скриптов здесь. Эта цель не поддерживает основные модули Node.js, как поясняет ошибка.
Библиотека, которую вы хотите использовать, node-irc , представляет собой библиотеку Node.js, и вы не можете использовать Node.js на стороне браузера, как React. Если вы хотите использовать эту библиотеку, вам понадобится серверная часть Node.js. Это также объяснено в этом выпуске другим пользователем.
Спасибо. Мне нужно многому научиться. Я рассмотрю документацию node-irc и node.js, чтобы понять, как я это реализую.
Если вам нужно просмотреть содержимое App.js или ForumsandIRC.js, пожалуйста, напишите мне в личку.